mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-01 14:22:31 -08:00
Covers the two bugs fixed in the previous commit: - Verifies the first button gets data-selected="true" on initial render so the CSS highlight rule fires immediately (regression for the dep-array fix). - Verifies the first button is also stamped when async search results load new buttons after the initial render (the original regression). - Verifies keyboard navigation via the AUTOCOMPLETE_NAVIGATE_EVENT moves the selected index and that it clamps at the list boundaries. Also adds an eslint-disable comment in AutocompleteMenu.tsx explaining why the no-dep-array useLayoutEffect is intentional (setSelectedIndex is a stable React setter; the conditional call cannot cause an infinite loop).