jenkins-bot has submitted this change and it was merged.

Change subject: Fix moving over an image with the arrow keys in Firefox
......................................................................


Fix moving over an image with the arrow keys in Firefox

There was a bug when you moved over an image with the arrow keys:
if your selection was on an image and you pressed an arrow key, the
selection would move but focus would remain with the paste target
rather than going back to the document node, which caused strange
symptoms (immobilizing the arrow keys and scrolling horizontally)
in Firefox.

Bug: 57600
Change-Id: Iaf6a49787dd2fd2f3f88abd0d1f5ae512fd3fd68
---
M modules/ve/ce/ve.ce.Surface.js
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Divec: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index 125b7d9..c52b268 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -947,6 +947,12 @@
                if ( previous ) {
                        previous.setFocused( false );
                        this.focusedNode = null;
+                       if ( !next ) {
+                               // If the selection is moving from a focusable 
node (in the paste target) back
+                               // to a normal selection (in the document 
node), give the focus back to the
+                               // document node.
+                               
this.documentView.getDocumentNode().$element[0].focus();
+                       }
                }
                if ( next ) {
                        next.setFocused( true );

-- 
To view, visit https://gerrit.wikimedia.org/r/97750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf6a49787dd2fd2f3f88abd0d1f5ae512fd3fd68
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Divec <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Divec <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to