Skip to content

Commit d6e357f

Browse files
committed
add debug
1 parent 0e8d5f2 commit d6e357f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

frontend/src/components/floating-menus/MenuList.svelte

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
$: watchOpen(open);
4444
$: watchEntries(entries);
4545
$: watchRemeasureWidth(filteredEntries, drawIcon);
46-
$: watchHighlightedWithSearch(filteredEntries, open);
46+
// $: watchHighlightedWithSearch(filteredEntries, open);
4747
4848
$: filteredEntries = entries.map((section) => section.filter((entry) => inSearch(search, entry)));
4949
$: virtualScrollingTotalHeight = filteredEntries.length === 0 ? 0 : filteredEntries[0].length * virtualScrollingEntryHeight;
@@ -69,17 +69,17 @@
6969
}
7070
7171
// Required to keep the highlighted item centered and to find a new highlighted item if necessary
72-
async function watchHighlightedWithSearch(filteredEntries: MenuListEntry[][], open: boolean) {
73-
if (highlighted && open) {
74-
// Allows the scrollable area to expand if necessary
75-
await tick();
76-
77-
const flattened = filteredEntries.flat();
78-
const highlightedFound = highlighted?.label && flattened.map((entry) => entry.label).includes(highlighted.label);
79-
const newHighlighted = highlightedFound ? highlighted : flattened[0];
80-
setHighlighted(newHighlighted);
81-
}
82-
}
72+
// async function watchHighlightedWithSearch(filteredEntries: MenuListEntry[][], open: boolean) {
73+
// if (highlighted && open) {
74+
// // Allows the scrollable area to expand if necessary
75+
// await tick();
76+
77+
// const flattened = filteredEntries.flat();
78+
// const highlightedFound = highlighted?.label && flattened.map((entry) => entry.label).includes(highlighted.label);
79+
// const newHighlighted = highlightedFound ? highlighted : flattened[0];
80+
// setHighlighted(newHighlighted);
81+
// }
82+
// }
8383
8484
// Detect when the user types, which creates a search box
8585
async function startSearch(e: KeyboardEvent) {

0 commit comments

Comments
 (0)