Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(select): fix select focus loss #3309

Merged
merged 3 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fix `n-upload`'s `on-error` & `on-finish` props don't allow `() => void` type, closes [#3290](https://github.com/TuSimple/naive-ui/issues/3290).
- Fix `n-select`'s placeholder may overflow if it's long.
- Fix `n-input` has is no indent at the prefix if `type="textarea"` and `:autosize="true"`, closes [#3238](https://github.com/TuSimple/naive-ui/issues/3238).
- Fix `n-select` focus loss when click `action` slot in `filterable` and `multiple`, closes [#3247](https://github.com/TuSimple/naive-ui/issues/3247).
- Fix `n-carousel`'s `autoplay` prop be `true` `hover` can't stop the play, closes [#3304](https://github.com/TuSimple/naive-ui/issues/3304).

### Feats
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- 修复 `n-upload` 的 `on-error` 和 `on-finish` 属性不允许 `() => void` 类型,关闭 [#3290](https://github.com/TuSimple/naive-ui/issues/3290)
- 修复 `n-select` 的 placeholder 过长时可能溢出
- 修复 `n-input` 在 `type="textarea"` 并且 `:autosize="true"` 时添加 prefix 后内容没有对齐,关闭 [#3238](https://github.com/TuSimple/naive-ui/issues/3238)
- 修复 `n-select` 当在同时设置 `filterable` 和 `multiple` 时点击 `action` 焦点丢失的问题,关闭 [#3247](https://github.com/TuSimple/naive-ui/issues/3247)
- 修复 `n-carousel` 在 `autoplay` 为 `true` 时 `hover` 不停止播放,关闭 [#3304](https://github.com/TuSimple/naive-ui/issues/3304)

### Feats
Expand Down
2 changes: 2 additions & 0 deletions src/select/src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ export default defineComponent({
if (!props.filterable) {
// already focused, don't need to return focus
closeMenu()
} else {
focusSelectionInput()
}
}
}
Expand Down