Skip to content

Commit caa1595

Browse files
Mihai PopescuMihai Popescu
authored andcommitted
Fixed the issue where Cmd+Left Arrow was being intercepted by the TreeView component.
Solution: Added a check in the getTreeProps keyboard handler to detect when metaKey (Cmd on macOS) is pressed with Left Arrow. When detected, the handler returns early without preventing the default browser behavior, allowing Chrome's native back navigation to work. Changes: Modified TreeView.tsx to check for e.metaKey before handling Left Arrow key events When Cmd+Left is pressed, the event is no longer prevented, allowing browser default behavior
1 parent cf63fc9 commit caa1595

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/webapp/app/components/primitives/TreeView/TreeView.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ export function useTree<TData, TFilterValue>({
423423
}
424424
case "Left":
425425
case "ArrowLeft": {
426+
if (e.metaKey) {
427+
return;
428+
}
429+
426430
e.preventDefault();
427431

428432
const selected = selectedIdFromState(state.nodes);

0 commit comments

Comments
 (0)