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

[@mantine/core] fix multi-select hovered item on last item select #4168

Merged
merged 1 commit into from
May 2, 2023

Conversation

jvdsande
Copy link
Contributor

When disableSelectedItemFiltering is set to true, selecting the last item will move the focus to the second-to-last instead of keeping it on the last.

This is due to a workaround for selected-item detection needed in normal mode.

This PR changes the workaround: instead of handling it as an edge-case in handleItemSelect, I converted it into a rule in the render: hovered should never be greater than the last item's index.

This way if the item number does not change on select, the hovered value is not impacted.

@rtivital rtivital merged commit 959f7dd into mantinedev:master May 2, 2023
1 check passed
@rtivital
Copy link
Member

rtivital commented May 2, 2023

Thanks!

agong-coveo pushed a commit to agong-coveo/mantine that referenced this pull request May 3, 2023
…isableSelectedItemFiltering` is set and last item is selected (mantinedev#4168)

Co-authored-by: jvandersande <jeremie.van-der-sande@ubisoft.com>
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.

None yet

2 participants