DLynch has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/338994 )
Change subject: LinearEnterKeyDownHandler: abort if in dialog and ctrl/cmd held
......................................................................
LinearEnterKeyDownHandler: abort if in dialog and ctrl/cmd held
OOUI behavior is to close+submit a dialog if ctrl/cmd+enter is pressed. If
this dialog is going to close, we don't want to perform any actions.
Bug: T158321
Change-Id: I58edf7ea258d819715e744e3683526868b8127b8
---
M src/ce/keydownhandlers/ve.ce.LinearEnterKeyDownHandler.js
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/94/338994/1
diff --git a/src/ce/keydownhandlers/ve.ce.LinearEnterKeyDownHandler.js
b/src/ce/keydownhandlers/ve.ce.LinearEnterKeyDownHandler.js
index c12853f..a0ff3c3 100644
--- a/src/ce/keydownhandlers/ve.ce.LinearEnterKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.LinearEnterKeyDownHandler.js
@@ -49,6 +49,13 @@
e.preventDefault();
+ if ( ( e.ctrlKey || e.metaKey ) && surface.getSurface().getInDialog() )
{
+ // We're inside a dialog. OOUI behavior is to close+submit a
dialog if
+ // ctrl/cmd+enter is pressed. If this dialog is going to close,
we
+ // don't want to perform any actions.
+ return true;
+ }
+
focusedNode = surface.getFocusedNode();
if ( focusedNode ) {
focusedNode.executeCommand();
--
To view, visit https://gerrit.wikimedia.org/r/338994
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I58edf7ea258d819715e744e3683526868b8127b8
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits