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

Adjust active {item,option} index #1184

Merged
merged 2 commits into from
Mar 2, 2022
Merged

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Mar 2, 2022

We had various ordering issues, and now we properly sort all the nodes which is awesome. However, there is this case where we still use the activeOptionIndex / activeItemIndex from before the sort happens.

Now we will ensure that this is properly adjusted when performing the sort of the items.

In addition, we will also properly adjust these values when registering and unregistering items, not only when performing actions.

Fixes: #1170

@vercel
Copy link

vercel bot commented Mar 2, 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/playground-react

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-react/3GWQ8M5hSGbCuaKYCCVayzLNW7Nb
✅ Preview: https://headlessui-react-git-adjust-active-option-index-tailwindlabs.vercel.app

headlessui-vue – ./packages/playground-vue

🔍 Inspect: https://vercel.com/tailwindlabs/headlessui-vue/32AtnpUMwhVw9HS1e5Hp2kFmgt8e
✅ Preview: https://headlessui-vue-git-adjust-active-option-index-tailwindlabs.vercel.app

We had various ordering issues, and now we properly sort all the notes
which is awesome. However, there is this case where we still use the
`activeOptionIndex` / `activeItemIndex` from _before_ the sort happens.

Now we will ensure that this is properly adjusted when performing the
sort of the items.

In addition, we will also properly adjust these values when
`registering` and `unregistering` items, not only when performing
actions.
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.

Small skipping of items during arrow navigation
1 participant