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] MultiSelect: Fix disableSelectedItemFiltering prop not working for searchable input #3894

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

lgaspari
Copy link
Contributor

Solves #3877

It enables the disableSelectedItemFiltering feature for searchable inputs by always setting the filter function's selected parameter to false.

This works for the internal defaultFilter and should work for any custom filter function that relies on the selected parameter to remove from the list.

Lastly, I added some tests to assert:

  • disableSelectedItemFiltering when input is not searchable
  • disableSelectedItemFiltering when input is searchable (uses defaultFilter)
  • filter function's selected paramater is alwaysfalse when disableSelectedItemFiltering and searchable are enabled (generic test for any custom filter function)

@rtivital rtivital merged commit d985250 into mantinedev:dev Mar 28, 2023
@rtivital
Copy link
Member

Thanks!

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.

2 participants