Don't trigger hotkeys within sidebar edit input

This commit is contained in:
Gregory Schier
2025-10-28 13:03:37 -07:00
parent 5b8114f6f3
commit a71fb8ed6c
2 changed files with 16 additions and 11 deletions

View File

@@ -156,7 +156,7 @@ function TreeItem_<T extends { id: string }>({
const handleEditKeyDown = useCallback(
async (e: React.KeyboardEvent<HTMLInputElement>) => {
e.stopPropagation();
e.stopPropagation(); // Don't trigger other tree keys (like arrows)
switch (e.key) {
case 'Enter':
if (editing) {
@@ -331,6 +331,7 @@ function TreeItem_<T extends { id: string }>({
const { defaultValue, placeholder } = getEditOptions(node.item);
return (
<input
data-disable-hotkey
ref={handleEditFocus}
defaultValue={defaultValue}
placeholder={placeholder}