File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
super_editor/lib/src/default_editor Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -364,10 +364,10 @@ class _DocumentMouseInteractorState extends State<DocumentMouseInteractor> with
364
364
}
365
365
366
366
_selectionType = SelectionType .word;
367
- _clearSelection () ;
367
+ bool didSelectContent = false ;
368
368
369
369
if (docPosition != null ) {
370
- bool didSelectContent = _selectWordAt (
370
+ didSelectContent = _selectWordAt (
371
371
docPosition: docPosition,
372
372
docLayout: _docLayout,
373
373
);
@@ -389,6 +389,15 @@ class _DocumentMouseInteractorState extends State<DocumentMouseInteractor> with
389
389
}
390
390
}
391
391
392
+ // Only clear the existing selection if we were not able to place a new selection,
393
+ // because clearing the selection might close the IME connection, depending
394
+ // on the `SuperEditorImePolicies` used. If we cleared the selection and then
395
+ // placed a new selection, the IME connection would be closed and then immediately
396
+ // reopened, and this doesn't seem to work on Safari and Firefox.
397
+ if (! didSelectContent) {
398
+ _clearSelection ();
399
+ }
400
+
392
401
_focusNode.requestFocus ();
393
402
}
394
403
You can’t perform that action at this time.
0 commit comments