mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* fix(select):created option showed incorrectly#2826 fix https://github.com/element-plus/element-plus/issues/2826 * fix(select): options display fix when allow-create, also empty & entered fix #2826 #2854 Co-authored-by: hanx316 <xuanxinhan@vip.qq.com>
This commit is contained in:
@@ -81,16 +81,10 @@ export function useOption(props, states) {
|
||||
}
|
||||
|
||||
const queryChange = (query: string) => {
|
||||
// not in filtering, just show original options only
|
||||
if (!query) {
|
||||
states.visible = !props.created
|
||||
} else {
|
||||
// in filtering, do filter by RegExp
|
||||
const regexp = new RegExp(escapeRegexpString(query), 'i')
|
||||
states.visible = regexp.test(currentLabel.value)
|
||||
if (!states.visible && !props.created) {
|
||||
select.filteredOptionsCount--
|
||||
}
|
||||
const regexp = new RegExp(escapeRegexpString(query), 'i')
|
||||
states.visible = regexp.test(currentLabel.value) || props.created
|
||||
if (!states.visible) {
|
||||
select.filteredOptionsCount--
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user