Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typeahead search logic #1051

Merged
merged 2 commits into from
Jan 19, 2022
Merged

Improve typeahead search logic #1051

merged 2 commits into from
Jan 19, 2022

Conversation

RobinMalfait
Copy link
Member

This PR will make some improvements to the typeahead logic.

This ensures that if you have 4 items:

  • Alice
  • Bob
  • Charlie
  • Bob

And you search for b, then you jump to the first Bob, but if yuo
search again for b then we used to go to the very first Bob because
we always searched from the top. Now we will search from the active item
and onwards. Which means that we will now jump to the second Bob.

Closes: #1046

This ensures that if you have 4 items:
- Alice
- Bob
- Charlie
- Bob

And you search for `b`, then you jump to the first `Bob`, but if yuo
search again for `b` then we used to go to the very first `Bob` because
we always searched from the top. Now we will search from the active item
and onwards. Which means that we will now jump to the second `Bob`.
@vercel
Copy link

vercel bot commented Jan 19, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

headlessui-react – ./packages/@headlessui-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/6GNofQuCiS1aSiWvUZrVUTngY9HW
✅ Preview: https://headlessui-react-git-improve-typeahead-logic-tailwindlabs.vercel.app

headlessui-vue – ./packages/@headlessui-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/ADjjPEVdkpjnqEzupXwaFnHv4yeX
✅ Preview: https://headlessui-vue-git-improve-typeahead-logic-tailwindlabs.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typeahead does not follow the WAI-ARIA spec when repeatedly typing a character
1 participant