File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,10 @@ export default class ContentEditableInput {
59
59
}
60
60
} )
61
61
62
- on ( div , "touchstart" , ( ) => input . forceCompositionEnd ( ) )
62
+ on ( div , "touchstart" , ( ) => {
63
+ input . forceCompositionEnd ( )
64
+ input . lastTap = + new Date ( )
65
+ } )
63
66
64
67
on ( div , "input" , ( ) => {
65
68
if ( ! this . composing ) this . readFromDOMSoon ( )
@@ -349,6 +352,11 @@ export default class ContentEditableInput {
349
352
}
350
353
forceCompositionEnd ( ) {
351
354
if ( ! this . composing ) return
355
+ if ( + new Date ( ) < this . lastTap - 400 ) return
356
+ var startPos = cm . indexFromPos ( cm . getCursor ( 'from' ) )
357
+ var endPos = cm . indexFromPos ( cm . getCursor ( 'to' ) )
358
+ if ( startPos !== endPos ) return // do not force composition during selection
359
+
352
360
clearTimeout ( this . readDOMTimeout )
353
361
this . composing = null
354
362
this . updateFromDOM ( )
You can’t perform that action at this time.
0 commit comments