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

Do not validate options by default in OptionsDropdown #7177

Conversation

ustun-ed
Copy link
Contributor

@ustun-ed ustun-ed commented Nov 27, 2024

Previously Mantine punished the common scenario of duplicate keys too heavily, resulting in component failures in duplicate options data. Now duplicate values are silently ignored as in React.

Fixes #7176

Note that I opened the PR to initiate discussion, it is currently lacking tests/documentation. I can add those if we can agree with this solution.

@ustun-ed ustun-ed marked this pull request as draft November 27, 2024 10:59
@ustun-ed ustun-ed force-pushed the ustun/do-not-validate-options-dropdown-options-by-default branch from ef69b88 to aab430a Compare November 27, 2024 11:13
@ustun-ed ustun-ed marked this pull request as ready for review November 27, 2024 11:21
…, MultiSelect and Select

Previously Mantine punished the common scenario of duplicate keys too heavily, resulting in component failures in duplicate options data. Now duplicate values are silently ignored as in React.
@ustun-ed ustun-ed force-pushed the ustun/do-not-validate-options-dropdown-options-by-default branch from f542d13 to 27cb9d7 Compare November 27, 2024 11:23
@rtivital
Copy link
Member

It is not planned to change this behavior. If options are not unique, Combobox component will not work correctly, all of its features are bound to option value, including keyboard navigation, option retrieving from the list and scrolling to a specific option. The function is implemented to throw an error to explicitly notify the developer that the data cannot be processed.

To fix the issue, transform the data on your side before passing it to the component.

@rtivital rtivital closed this Nov 27, 2024
@ustun-ed ustun-ed deleted the ustun/do-not-validate-options-dropdown-options-by-default branch November 28, 2024 09:53
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.

Option validation in ComboBox is too strict
2 participants