File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 31
31
:autocomplete =" autoComplete || autocomplete"
32
32
ref =" input"
33
33
@compositionstart =" handleCompositionStart"
34
+ @compositionupdate =" handleCompositionUpdate"
34
35
@compositionend =" handleCompositionEnd"
35
36
@input =" handleInput"
36
37
@focus =" handleFocus"
87
88
:tabindex =" tabindex"
88
89
class =" el-textarea__inner"
89
90
@compositionstart =" handleCompositionStart"
91
+ @compositionupdate =" handleCompositionUpdate"
90
92
@compositionend =" handleCompositionEnd"
91
93
@input =" handleInput"
92
94
ref =" textarea"
109
111
import Migrating from ' element-ui/src/mixins/migrating' ;
110
112
import calcTextareaHeight from ' ./calcTextareaHeight' ;
111
113
import merge from ' element-ui/src/utils/merge' ;
114
+ import {isKorean } from ' element-ui/src/utils/shared' ;
112
115
113
116
export default {
114
117
name: ' ElInput' ,
336
339
handleCompositionStart () {
337
340
this .isComposing = true ;
338
341
},
342
+ handleCompositionUpdate (event ) {
343
+ const text = event .target .value ;
344
+ const lastCharacter = text[text .length - 1 ] || ' ' ;
345
+ this .isComposing = ! isKorean (lastCharacter);
346
+ },
339
347
handleCompositionEnd (event ) {
340
- this .isComposing = false ;
341
- this .handleInput (event );
348
+ if (this .isComposing ) {
349
+ this .isComposing = false ;
350
+ this .handleInput (event );
351
+ }
342
352
},
343
353
handleInput (event ) {
344
354
// should not emit input during composition
You can’t perform that action at this time.
0 commit comments