fix(select): being created option is not cleared after menu is closed

This commit is contained in:
07akioni 2022-02-04 02:01:38 +08:00
parent 938b419dd3
commit 5b7504f3d0
3 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@
- Fix `n-popselect` action slot & empty slot now working.
- Fix `n-data-table` can't use percent as column width.
- Fix `n-select` trigger shows blank for a while when `filterable=true` and menu is closing.
- Fix `n-select`'s being created option is not cleared after menu is closed.
### Feats

View File

@ -17,6 +17,7 @@
- 修复 `n-popselect` action slot & empty slot 不生效
- 修复 `n-data-table` 不能使用百分比列宽
- 修复 `n-select` 在可过滤,关闭菜单并且没有选中任何值的时候选框会空一下
- 修复 `n-select` 在动态创建选项时关闭菜单后创建中的选项未清空
### Feats

View File

@ -386,7 +386,6 @@ export default defineComponent({
}
function openMenu (): void {
if (!mergedDisabledRef.value) {
patternRef.value = ''
doUpdateShow(true)
uncontrolledShowRef.value = true
if (props.filterable) {
@ -399,6 +398,7 @@ export default defineComponent({
}
function handleMenuAfterLeave (): void {
patternRef.value = ''
beingCreatedOptionsRef.value = []
}
function handleTriggerClick (): void {
if (mergedDisabledRef.value) return