File tree 1 file changed +14
-1
lines changed
components/vc-input-number/src
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,10 @@ export default defineComponent({
265
265
266
266
this . __emit ( 'keyup' , e , ...args ) ;
267
267
} ,
268
+ onTrigger ( e ) {
269
+ if ( e . target . composing ) return false ;
270
+ this . onChange ( e ) ;
271
+ } ,
268
272
onChange ( e ) {
269
273
if ( this . $data . focused ) {
270
274
this . inputting = true ;
@@ -631,6 +635,13 @@ export default defineComponent({
631
635
saveInput ( node ) {
632
636
this . inputRef = node ;
633
637
} ,
638
+ onCompositionstart ( e ) {
639
+ e . target . composing = true ;
640
+ } ,
641
+ onCompositionend ( e ) {
642
+ this . onChange ( e ) ;
643
+ e . target . composing = false ;
644
+ } ,
634
645
} ,
635
646
render ( ) {
636
647
const props = { ...this . $props , ...this . $attrs } ;
@@ -791,7 +802,9 @@ export default defineComponent({
791
802
name = { this . name }
792
803
title = { this . title }
793
804
id = { this . id }
794
- onInput = { this . onChange }
805
+ onInput = { this . onTrigger }
806
+ onCompositionstart = { this . onCompositionstart }
807
+ onCompositionend = { this . onCompositionend }
795
808
ref = { this . saveInput }
796
809
value = { inputDisplayValue }
797
810
pattern = { this . pattern }
You can’t perform that action at this time.
0 commit comments