Skip to content

Commit

Permalink
fix(popselect): header make inner input unavailable, closes #5494
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Jan 23, 2024
1 parent a604c4b commit 8c46915
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@

- Fix `n-tree`'s `override-default-node-click-behavior` prop may conflict with default switcher click or checkbox click behavior.
- Fix `n-scrollbar`'s typo on `aria-hidden` attribute.
- `n-drawer` adds `borderRadius` attribute
- Fix overflow issue with `n-menu` `root-indent` `indent`, closes (#5616)
- Fix `n-form-item`'s feedback may hide and show again, closes [#5583](https://github.com/tusen-ai/naive-ui/issues/5583).
- Fix `n-popselect`'s header make inner input unavailable, closes [#5494](https://github.com/tusen-ai/naive-ui/pull/5494).

### Features

- `n-auto-complete` adds `append` prop.
- `n-select` add native `title` attribute when `filterable` and blur input.
- `n-split` adds `size` prop and `on-update:size` prop.
- `n-split` adds `watch-props` prop, closes [#5526](https://github.com/tusen-ai/naive-ui/issues/5526).
- `n-drawer` adds `borderRadius` theme variable.

### i18n

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@

- 修复 `n-tree``override-default-node-click-behavior` 属性可能覆盖掉默认展开按钮和选中按钮的行为
- Fix `n-scrollbar`'s typo on `aria-hidden` attribute.
- `n-drawer` 新增 `borderRadius` 属性
- 修复 `n-menu` `root-indent` `indent` 下内容溢出的问题,关闭 #5616
- 修复 `n-form-item` 校验结果可能会闪烁的问题,关闭 [#5583](https://github.com/tusen-ai/naive-ui/issues/5583)
- 修复 `n-popselect` 组件的 header 插槽里 input 无法输入,关闭 [#5494](https://github.com/tusen-ai/naive-ui/pull/5494)

### Features

- `n-auto-complete` 新增 `append` 属性
- `n-select` 在组件可过滤且输入失焦时,添加原生 `title` 属性
- `n-split` 新增 `size``on-update:size` 属性
- `n-split` 新增 `watch-props` 属性,关闭 [#5526](https://github.com/tusen-ai/naive-ui/issues/5526)
- `n-drawer` 新增 `borderRadius` 主题变量

### i18n

Expand Down
8 changes: 7 additions & 1 deletion src/popselect/src/PopselectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ export default defineComponent({
toggle(tmNode.key)
}
function handleMenuMousedown (e: MouseEvent): void {
if (!happensIn(e, 'action') && !happensIn(e, 'empty')) e.preventDefault()
if (
!happensIn(e, 'action') &&
!happensIn(e, 'empty') &&
!happensIn(e, 'header')
) {
e.preventDefault()
}
}
function toggle (value: ValueAtom): void {
const {
Expand Down

0 comments on commit 8c46915

Please sign in to comment.