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

fixes #3200 Add Generics to #3211

Closed
wants to merge 11 commits into from
Closed

Conversation

DariusRDev
Copy link
Contributor

@DariusRDev DariusRDev commented Aug 30, 2022

Adds Generics to Dropdown, Listbox, Multiselect and Selectbutton #3200

Gives Autocomplete to the optionValue optionLabel opionGroupLabel and optionGroupChildren Props while still allowing all String values:
optionLabel?: NestedKeyOf<TOption> | Omit<NestedKeyOf<TOption>, string>;
The Omit makes that VS-Code Autocompletes.
if you would only use :
optionLabel?: NestedKeyOf<TOption> | string
it wouldn't Autocomplete
Also see:
#3207 (comment)

Because the onChange Value Type depends on the optionValue and optionGroupChildren Props they are now conditional types.
More Info:
#3207 (comment)

@DariusRDev DariusRDev closed this Aug 30, 2022
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