jenkins-bot has submitted this change and it was merged.
Change subject: Only showSelection if checkSequences actually matched something
......................................................................
Only showSelection if checkSequences actually matched something
The unconditional showSelection in ve.ce.Surface checkSequences was breaking
most IMEs, because it removes the existing selection, which closes the
candidate window.
We are still calling checkSequences at a time when we are not certain it is
IME-safe to make changes, but in practice this is probably less dangerous,
because for most common IMEs there will be no candidate when one of the
currently recognized sequences matches.
Applying the model selection under setTimeout can conflict with IMEs that
cause multiple events in a single tick. This does happen in practice, e.g.
typing ASCII from within Korean IME, but it is an edge case and the fix is
more complex. We should investigate whether ve.EventSequencer afterLoopOne can
make this safer.
Change-Id: Id89e84b5deb818ff4f978ac13e75cf70880df7f0
---
M src/ce/ve.ce.Surface.js
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
Objections:
Esanders: There's a problem with this change, please improve
diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index b39730c..2154f5a 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -2346,7 +2346,9 @@
for ( i = 0; i < sequences.length; i++ ) {
sequences[i].execute( this.surface );
}
- this.showSelection( this.surface.getModel().getSelection() );
+ if ( sequences.length > 0 ) {
+ this.showSelection( this.surface.getModel().getSelection() );
+ }
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/176070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id89e84b5deb818ff4f978ac13e75cf70880df7f0
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Divec <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits