Skip to content

Commit

Permalink
fix(tree): #2622 编辑框onKeyDown事件增加阻止冒泡处理
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Oct 13, 2023
1 parent 9174d39 commit dcbb300
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
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

0 comments on commit dcbb300

Please sign in to comment.