Skip to content

Commit 663905f

Browse files
committed
refactor(vc-time-picker): input value is always synchronized with sValue vueComponent#4084
1 parent 07b4150 commit 663905f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/vc-time-picker/TimePicker.jsx

+6
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ export default defineComponent({
326326
</a>
327327
);
328328
},
329+
onInput() {
330+
// input value is always synchronized with sValue
331+
// ref: https://github.com/vueComponent/ant-design-vue/issues/4084
332+
this.picker.value = (this.sValue && this.sValue.format(this.getFormat())) || '';
333+
},
329334
},
330335

331336
render() {
@@ -378,6 +383,7 @@ export default defineComponent({
378383
disabled={disabled}
379384
value={(sValue && sValue.format(this.getFormat())) || ''}
380385
autocomplete={autocomplete}
386+
onInput={this.onInput}
381387
onFocus={onFocus}
382388
onBlur={onBlur}
383389
autofocus={autofocus}

0 commit comments

Comments
 (0)