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:
ByteAtATime 2025-07-13 11:17:19 -07:00
parent 4b33d36212
commit 11fe6fcacb
No known key found for this signature in database

View file

@ -30,8 +30,10 @@
return;
}
event.preventDefault();
onPopView?.();
if (onPopView) {
event.preventDefault();
onPopView();
}
}
};
</script>