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(tree): #2622 编辑框onKeyDown事件增加阻止冒泡处理 #2623

Merged
merged 1 commit into from
Oct 13, 2023
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
5 changes: 5 additions & 0 deletions .changeset/clean-jars-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

Tree fix: 修复编辑状态下键盘无法移动光标问题
5 changes: 5 additions & 0 deletions .changeset/stale-impalas-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/tree": patch
---

fix: 修复编辑状态下键盘无法移动光标问题
3 changes: 2 additions & 1 deletion packages/ui/tree/src/use-tree-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,10 @@ const EditableNodeInput = (props: EditableNodeInputProps) => {
}

const onKeydown = (evt: React.KeyboardEvent<HTMLInputElement>) => {
evt.stopPropagation()

if (evt.keyCode === 13) {
evt.preventDefault()
evt.stopPropagation()

saveEdit()
}
Expand Down