Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/81027


Change subject: Give document real focus after cut
......................................................................

Give document real focus after cut

If only a FocusableNode is selected the document doesn't have
real focus, so we must do it manually.

Change-Id: I781f59dda7f2884ff02f6688c2c8c037ac7ed1a6
---
M modules/ve/ce/ve.ce.Surface.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/27/81027/1

diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index 2dbed0b..bde80d7 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -581,6 +581,9 @@
                // Transact
                tx = ve.dm.Transaction.newFromRemoval( this.documentView.model, 
selection );
 
+               // Document may not have had real focus (e.g. with a 
FocusableNode)
+               this.documentView.documentNode.$[0].focus();
+
                this.model.change( tx, new ve.Range( selection.start ) );
                this.surfaceObserver.clear();
                this.surfaceObserver.start();
@@ -696,7 +699,7 @@
                );
 
                // Restore focus and scroll position
-               view.documentView.documentNode.$.focus();
+               view.documentView.documentNode.$[0].focus();
                $window.scrollTop( scrollTop );
 
                selection = tx.translateRange( selection );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I781f59dda7f2884ff02f6688c2c8c037ac7ed1a6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

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

Reply via email to