Catrope has submitted this change and it was merged.

Change subject: Make cursoring over a FocusableNode work again
......................................................................


Make cursoring over a FocusableNode work again

When you cursor onto a FocusableNode, it's selected, and we focus the
paste target as part of our hack to make copying FocusableNodes work
in Firefox. But then when you press the arrow key again, that event
isn't picked up by anything, and you can't move the cursor off the
FocusableNode using the keyboard.

Fixed by attaching the EventSequencer to this.$ (which is the parent
of $documentNode and $pasteTarget) and listening for focus/blur on
both $documentNode and $pasteTarget.

Bug: 54443
Change-Id: I7bddcfa9fa6f38908e315c97623bd27133daa98d
(cherry picked from commit 5592ea2602c31e2cb8ba34a339dd951ab45c507b)
---
M modules/ve/ce/ve.ce.Surface.js
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Catrope: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index 3264a06..6efcb13 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -67,7 +67,10 @@
        } );
        this.$pasteTarget.on( {
                'cut': ve.bind( this.onCut, this ),
-               'copy': ve.bind( this.onCopy, this )
+               'copy': ve.bind( this.onCopy, this ),
+               // $pasteTarget is focused when selecting a FocusableNode
+               'focus': ve.bind( this.documentOnFocus, this ),
+               'blur': ve.bind( this.documentOnBlur, this )
        } );
        $documentNode.on( $.browser.msie ? 'beforepaste' : 'paste', ve.bind( 
this.onPaste, this ) );
        $documentNode.on( 'focus', 'a', function () {
@@ -323,7 +326,7 @@
  * @param {jQuery.Event} e Focus event
  */
 ve.ce.Surface.prototype.documentOnFocus = function () {
-       this.eventSequencer.attach( this.$document );
+       this.eventSequencer.attach( this.$ );
        this.surfaceObserver.startTimerLoop();
 };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7bddcfa9fa6f38908e315c97623bd27133daa98d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.22wmf19
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to