mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-06 05:09:00 +08:00
fix(components): [select] keep hover after clearing (#9644)
This commit is contained in:
parent
390f5bd8ee
commit
dee98ed32a
@ -322,6 +322,8 @@ export const useSelect = (props, states: States, ctx) => {
|
||||
(val) => {
|
||||
if (typeof val === 'number' && val > -1) {
|
||||
hoverOption.value = optionsArray.value[val] || {}
|
||||
} else {
|
||||
hoverOption.value = {}
|
||||
}
|
||||
optionsArray.value.forEach((option) => {
|
||||
option.hover = hoverOption.value === option
|
||||
@ -590,6 +592,7 @@ export const useSelect = (props, states: States, ctx) => {
|
||||
}
|
||||
ctx.emit(UPDATE_MODEL_EVENT, value)
|
||||
emitChange(value)
|
||||
states.hoverIndex = -1
|
||||
states.visible = false
|
||||
ctx.emit('clear')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user