fix(ext/popup): stop Escape from leaking past the generator panel
Two related bugs from the gen-panel rewrite (ac15f06):
1. Escape key was bubbling to view-level keydown handlers in login.ts
and settings-vault.ts, causing the press that closed the panel to
also navigate the user away from the form/settings. Fix: call
e.stopPropagation() in the panel's escHandler before closing.
2. settings-vault.teardown() didn't close any open generator panel,
leaving the panel's escHandler registered and activePanel state
stale across view transitions. Fix: call closeGeneratorPanel()
first in teardown.
Plus a configure-defaults context test for the action-row composition
(no use/cancel buttons in that context).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,10 @@ export function openGeneratorPanel(opts: OpenPanelOpts): void {
|
||||
opts.trigger.setAttribute('aria-expanded', 'true');
|
||||
|
||||
const escHandler = (e: KeyboardEvent): void => {
|
||||
if (e.key === 'Escape') closeGeneratorPanel();
|
||||
if (e.key === 'Escape') {
|
||||
e.stopPropagation();
|
||||
closeGeneratorPanel();
|
||||
}
|
||||
};
|
||||
document.addEventListener('keydown', escHandler);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user