mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-15 02:40:46 +08:00
fix(components): [select] call the exposes blur is invalid (#17691)
* fix(components): [select] call the exposes blur is invalid closed #17367 * chore: remove the unnecessary code
This commit is contained in:
parent
3f0842124b
commit
c24309aea0
@ -698,13 +698,9 @@ const useSelect = (props: ISelectV2Props, emit) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClickOutside = (event: Event) => {
|
const handleClickOutside = () => {
|
||||||
expanded.value = false
|
expanded.value = false
|
||||||
|
isFocused.value && blur()
|
||||||
if (isFocused.value) {
|
|
||||||
const _event = new FocusEvent('focus', event)
|
|
||||||
handleBlur(_event)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMenuEnter = () => {
|
const handleMenuEnter = () => {
|
||||||
|
@ -103,7 +103,7 @@ export const useSelect = (props: ISelectProps, emit) => {
|
|||||||
afterComposition: (e) => onInput(e),
|
afterComposition: (e) => onInput(e),
|
||||||
})
|
})
|
||||||
|
|
||||||
const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
|
const { wrapperRef, isFocused } = useFocusController(inputRef, {
|
||||||
beforeFocus() {
|
beforeFocus() {
|
||||||
return selectDisabled.value
|
return selectDisabled.value
|
||||||
},
|
},
|
||||||
@ -657,20 +657,16 @@ export const useSelect = (props: ISelectProps, emit) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const blur = () => {
|
const blur = () => {
|
||||||
handleClickOutside()
|
inputRef.value?.blur()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClearClick = (event: Event) => {
|
const handleClearClick = (event: Event) => {
|
||||||
deleteSelected(event)
|
deleteSelected(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClickOutside = (event: Event) => {
|
const handleClickOutside = () => {
|
||||||
expanded.value = false
|
expanded.value = false
|
||||||
|
isFocused.value && blur()
|
||||||
if (isFocused.value) {
|
|
||||||
const _event = new FocusEvent('focus', event)
|
|
||||||
nextTick(() => handleBlur(_event))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleEsc = () => {
|
const handleEsc = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user