mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
fix(select): closes menu when enter key is pressed in filterable mode without options data
This commit is contained in:
parent
1864eb5e61
commit
c13b27bb20
@ -14,6 +14,7 @@
|
||||
### Fixes
|
||||
|
||||
- Fix `n-p` warns when `depth` is number.
|
||||
- Fix `n-select` closes menu when enter key is pressed in filterable mode without options data.
|
||||
|
||||
## 2.18.1 (2021-09-08)
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
### Fixes
|
||||
|
||||
- 修复 `n-p` `depth` 传入 number 报错
|
||||
- 修复 `n-select` 在 filterable 并且菜单无数据是按下 enter 导致菜单关闭
|
||||
|
||||
## 2.18.1 (2021-09-08)
|
||||
|
||||
|
@ -582,11 +582,10 @@ export default defineComponent({
|
||||
case 'Enter':
|
||||
case 'NumpadEnter':
|
||||
if (mergedShowRef.value) {
|
||||
const menu = menuRef.value
|
||||
const pendingOptionData = menu?.getPendingTmNode()
|
||||
if (pendingOptionData) {
|
||||
handleToggleByTmNode(pendingOptionData)
|
||||
} else {
|
||||
const pendingTmNode = menuRef.value?.getPendingTmNode()
|
||||
if (pendingTmNode) {
|
||||
handleToggleByTmNode(pendingTmNode)
|
||||
} else if (!props.filterable) {
|
||||
closeMenu()
|
||||
focusSelection()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user