fix(SearchPalette): return null while closed

The Overlay refactor dropped the early return, so the fixed-inset backdrop
stayed mounted permanently: the palette covered the page and swallowed
every click. Restore the guard and cover it with tests.
This commit is contained in:
developer committed 2026-09-15 18:28:38 +00:00
1 parent f6e81afe5e
commit 72ff61f94d
2 files changed
+44

No files matched your search

+5
View File
@@ -197,6 +197,11 @@ export function SearchPalette({ isOpen, onClose, onSelect, initialQuery = '' }:
trapTabKey(e, panelRef.current)
}
/* Closed palette must not render at all: the backdrop is `position: fixed;
inset: 0`, so rendering it unconditionally left the modal permanently on
screen (and ate every click on the page underneath). */
if (!isOpen) return null
return (
<div className="search-palette-backdrop" onClick={onClose}>
<div