diff --git a/packages/search/index.ts b/packages/search/index.ts index fba32f2d..7a0088cb 100644 --- a/packages/search/index.ts +++ b/packages/search/index.ts @@ -37,9 +37,15 @@ VantComponent({ }, onCancel() { - this.set({ value: '' }); - this.$emit('cancel'); - this.$emit('change', ''); + /** + * 修复修改输入框值时,输入框失焦和赋值同时触发,赋值失效 + * // https://github.com/youzan/vant-weapp/issues/1768 + */ + setTimeout(() => { + this.set({ value: '' }); + this.$emit('cancel'); + this.$emit('change', ''); + }, 200); }, onSearch() {