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

fix: improves type safty for autocomplete when optionLabel is required #3408

Merged

Conversation

FredrikMWold
Copy link
Contributor

This pull request improves autocomplete type safety.
The way it works now is that if the options are different from an array of strings then optionLabel is required. Typescript does not inform the user of this and the only feedback you get is a thrown error when you try and open the dropdown.

This PR makes it so that the optionLabel is optional if the options is an array of string, if not optionLabel becomes required.

@oddvernes
Copy link
Collaborator

Linting and tests are passing fine locally so disregard the failing github actions 👍

Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oddvernes
Copy link
Collaborator

This resolves #3007

@oddvernes oddvernes merged commit 89dd0df into equinor:develop Apr 30, 2024
4 of 6 checks passed
oddvernes added a commit that referenced this pull request Jun 13, 2024
oddvernes added a commit that referenced this pull request Jun 14, 2024
* Revert changes from #3408

* 🐛 fix for #3493, make options readonly

* bump version for test release

* restore version after testrelease
mhwaage pushed a commit to mhwaage/design-system that referenced this pull request Jul 29, 2024
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