diff --git a/.changeset/clean-jars-shop.md b/.changeset/clean-jars-shop.md new file mode 100644 index 000000000..d849ba147 --- /dev/null +++ b/.changeset/clean-jars-shop.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +Tree fix: 修复编辑状态下键盘无法移动光标问题 diff --git a/.changeset/stale-impalas-hunt.md b/.changeset/stale-impalas-hunt.md new file mode 100644 index 000000000..40168499b --- /dev/null +++ b/.changeset/stale-impalas-hunt.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/tree": patch +--- + +fix: 修复编辑状态下键盘无法移动光标问题 diff --git a/packages/ui/tree/src/use-tree-action.tsx b/packages/ui/tree/src/use-tree-action.tsx index 65d01409f..f9729a409 100644 --- a/packages/ui/tree/src/use-tree-action.tsx +++ b/packages/ui/tree/src/use-tree-action.tsx @@ -404,9 +404,10 @@ const EditableNodeInput = (props: EditableNodeInputProps) => { } const onKeydown = (evt: React.KeyboardEvent) => { + evt.stopPropagation() + if (evt.keyCode === 13) { evt.preventDefault() - evt.stopPropagation() saveEdit() }