-
Notifications
You must be signed in to change notification settings - Fork 668
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
Feature: setSelected() with value or setValue() on select #775
Comments
@eddyerburgh if you agree with this feature, I may have time to (try to) make a PR this week 😏 |
I like the idea, but not sure how it would work when you have multiple options with the same value? |
I always use options with unique values. Maybe this feature should also accept an Array as parameter to handle multiple select: select.setSelected(['value0', 'value1']); |
Ok, how about updating setValue to set the value of a selected element. Then there's no need to handle multiple options with the same value |
It sounds good to me |
May I create a PR or does this feature need more discussion/approval? |
Yes you can create a PR :) |
What problem does this feature solve?
In my tests I often use the same value (stored in a variable) to select an option and check the assertion.
Then the current setSelect() is not very convenient :
Same when selecting an option by value :
So I prefer to use :
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: