Skip to content

Commit

Permalink
fix: 🐛 修复Search、Input等组件clear事件在value变更前触发的问题
Browse files Browse the repository at this point in the history
Closes: #185
  • Loading branch information
xuqingkai committed Mar 5, 2024
1 parent 11e87cc commit 8d113a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@ function clear() {
.then(() => requestAnimationFrame())
.then(() => {
isFocus.value = true
emit('clear')
emit('change', {
value: ''
})
emit('update:modelValue', inputValue.value)
emit('clear')
})
}
// 失去焦点时会先后触发change、blur,未输入内容但失焦不触发 change 只触发 blur
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ function clearSearch() {
showPlaceHolder.value = true
hackFocus(false)
}
emit('clear')
emit('change', {
value: ''
})
emit('update:modelValue', '')
emit('clear')
})
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ function clear() {
.then(() => requestAnimationFrame())
.then(() => {
isFocus.value = true
emit('clear')
emit('change', {
value: ''
})
emit('update:modelValue', inputValue.value)
emit('clear')
})
}
// 失去焦点时会先后触发change、blur,未输入内容但失焦不触发 change 只触发 blur
Expand Down

0 comments on commit 8d113a2

Please sign in to comment.