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

SelectOption.value and Select.selected has "any" type, but Select.onSelect has "(..., string | number)" #11361

Open
mvollmer opened this issue Dec 19, 2024 · 1 comment

Comments

@mvollmer
Copy link

When looking at the SelectOption.value and Select.selected properties, I got the impression that one can use any JavaScript value to identify select options, and it indeed works as expected.

But it doesn't type-check: The Select.onSelect property wants a function that takes string | number. I had expected it to also use any.

We have our own variant of your SimpleSelect template, and we would like to make it generic in the type of the option value. This seems to work, except for this little niggle about the type of Select.onSelect.

@mvollmer
Copy link
Author

This is our attempt at making SimpleSelect and CheckboxSelect generic: cockpit-project/cockpit#21454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

1 participant