mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-31 03:07:23 +00:00
fix(command-palette): fix Escape key not hiding command palette
This commit updates the keydown handler within the shared `Header` component to fix a bug where the main window would not hide when Escape was pressed. Previously, the component would unconditionally consume the `Escape` key press, preventing it from reaching the global handler. The logic is now conditional, only preventing the default action if a back action (`onPopView`) is defined, which restores the expected behavior for the root command palette.
This commit is contained in:
parent
4b33d36212
commit
11fe6fcacb
1 changed files with 4 additions and 2 deletions
|
@ -30,8 +30,10 @@
|
|||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
onPopView?.();
|
||||
if (onPopView) {
|
||||
event.preventDefault();
|
||||
onPopView();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue