element [Feature Request] ELSelect click will closed drop-down selection box and clear input text

mrzz3bfm  于 2023-02-04  发布在  其他
关注(0)|答案(2)|浏览(134)

Existing Component

Component Name

ELSelect

Description

Hope to put the closed event on the icon on the right,I tried to rewrite the display switching method, but I don’t know if it’s right。

const toggleMenu = function({ target }) {
const $arrowEL = target.className.includes('arrow')
if (this.query && this.visible && !$arrowEL) return
if (!this.selectDisabled) {
if (this.menuVisibleOnFocus) {
this.menuVisibleOnFocus = false
if ($arrowEL) {
this.visible = !this.visible
}
} else {
this.visible = !this.visible
}
if (this.visible) {
(this.$refs.input || this.$refs.reference).focus()
}
}
}

6ie5vjzr

6ie5vjzr1#

Translation of this issue:

Existing Component

yes

Component Name

ELSelect

Description

Hope to put the closed event on the icon on the right,I tried to rewrite the display switching method, but I don’t know if it’s right。

const toggleMenu = function({ target }) {

const $arrowEL = target.className.includes ('arrow')
if ( this.query && this.visible && !$arrowEL) return

if (! this.selectDisabled ) {
if ( this.menuVisibleOnFocus ) {

this.menuVisibleOnFocus = false
if ($arrowEL) {

this.visible = ! this.visible
}

} else {
this.visible = ! this.visible

}
if ( this.visible ) {

(this.$ refs.input || this.$ refs.reference ).focus()
}

}
}

xxe27gdn

xxe27gdn2#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

相关问题