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

Rename prop duplicateFunc() to key() #238

Merged
merged 9 commits into from
Jun 18, 2023
Merged

Rename prop duplicateFunc() to key() #238

merged 9 commits into from
Jun 18, 2023

Conversation

janosh
Copy link
Owner

@janosh janosh commented Jun 14, 2023

Closes #234.

Add prop key: (opt: T) => unknown = (opt) => `${get_label(opt)}`.toLowerCase() which should map options to a value by which equality of options is determined. Used in add(option)/remove(option) functions, which previously had hacky hard-coded equality checks. key replaces duplicateFunc which served a similar purpose but with a worse API. It also wasn't used in add(option)/remove(option) even though arguably it should have been.

This is a breaking change and will be released as v10.

@janosh janosh added the fix Bug fix PRs label Jun 14, 2023
@janosh janosh changed the title Equal Rename prop duplicateFunc() to equal() Jun 15, 2023
@janosh janosh added the breaking Breaking change label Jun 15, 2023
@janosh janosh changed the title Rename prop duplicateFunc() to equal() Rename prop duplicateFunc() to key() Jun 18, 2023
@janosh janosh merged commit c5ac1ae into main Jun 18, 2023
@janosh janosh deleted the equal branch June 18, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change fix Bug fix PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Selected options stays visible in dropdown if options are objects
1 participant