mirror of
https://github.com/algometrix/second_brain_builder.git
synced 2026-07-22 08:29:32 +00:00
Fix mode search filtering and make Enter pick the first match
The .ch-hidden hide rule was overridden by .ch-card's display: flex, which has equal specificity but appears later in the stylesheet, so search never visually filtered the mode grid. Mark the hide rule !important. Enter in the search box now selects the first visible mode card. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5bab6531ff
commit
768e17acea
2 changed files with 11 additions and 2 deletions
|
|
@ -35,7 +35,14 @@ export function createModeGrid(
|
|||
card.addEventListener("click", () => onCardClick(mode, card));
|
||||
}
|
||||
|
||||
search.addEventListener("keydown", (e) => { e.stopPropagation(); });
|
||||
search.addEventListener("keydown", (e) => {
|
||||
e.stopPropagation();
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
const firstVisible = cards.find(c => !c.el.hasClass("ch-hidden"));
|
||||
firstVisible?.el.click();
|
||||
}
|
||||
});
|
||||
search.addEventListener("input", () => {
|
||||
const q = search.value.toLowerCase();
|
||||
for (const c of cards) {
|
||||
|
|
|
|||
|
|
@ -44,8 +44,10 @@
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* !important so this wins over .ch-card's display: flex, which has equal
|
||||
specificity but appears later in the sheet. */
|
||||
.ch-hidden {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* ─── Mode picker grid ─────────────────────────────────────────── */
|
||||
|
|
|
|||
Loading…
Reference in a new issue