File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ ContentEditableInput.prototype = copyObj({
3737 } ) , 20 )
3838 } )
3939
40- on ( div , "compositionstart" , e => {
41- let data = e . data
40+ function startComposing ( data ) {
4241 input . composing = { sel : cm . doc . sel , data : data , startData : data }
4342 if ( ! data ) return
4443 let prim = cm . doc . sel . primary ( )
@@ -47,8 +46,13 @@ ContentEditableInput.prototype = copyObj({
4746 if ( found > - 1 && found <= prim . head . ch )
4847 input . composing . sel = simpleSelection ( Pos ( prim . head . line , found ) ,
4948 Pos ( prim . head . line , found + data . length ) )
49+ }
50+
51+ on ( div , "compositionstart" , e => startComposing ( e . data ) )
52+ on ( div , "compositionupdate" , e => {
53+ if ( input . composing ) input . composing . data = e . data
54+ else startComposing ( e . data )
5055 } )
51- on ( div , "compositionupdate" , e => input . composing . data = e . data )
5256 on ( div , "compositionend" , e => {
5357 let ours = input . composing
5458 if ( ! ours ) return
You can’t perform that action at this time.
0 commit comments