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

Select component's value should not be an Option<T> #171

Closed
tqwewe opened this issue Apr 21, 2024 · 2 comments
Closed

Select component's value should not be an Option<T> #171

tqwewe opened this issue Apr 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@tqwewe
Copy link
Contributor

tqwewe commented Apr 21, 2024

The Select component takes a Model<Option<T>> for the value. But this over complicates things in most cases, since there select would never have a None option. So the user needs to .unwrap() or match on the value every time they need to access it.

If the Option is removed, and user does in fact need a None option for their select, then they can make their own value be Option<T>, whilst the Select component itself doesn't need to care if the value uses an Option or not.

If you're happy with this change, I can implement it in #166

@luoxiaozero
Copy link
Collaborator

It's a great idea. We can implement it.

If you're happy with this change, I can implement it in #166

I feel that multiple PR is often better than a single large PR, so we can implement it after the #166 merge.

@luoxiaozero luoxiaozero added the enhancement New feature or request label Apr 22, 2024
@luoxiaozero
Copy link
Collaborator

I have implemented this feature in the v0.4-beta version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants