[🚀 Feature]: Methods `Select.select*()` should NOT allow selecting DISABLED option (or select)
See original GitHub issueFeature and motivation
Currently Select
methods work even the option
is disabled. Or select
is disabled.
I suggest these selectByFoo
methods should throw an exception.
Usage example
new Select(element).selectByVisibleText("fish");
Pull request
Issue Analytics
- State:
- Created a year ago
- Comments:39 (27 by maintainers)
Top Results From Across the Web
Why is my select option not getting disabled? - Stack Overflow
Everytime one option is selected in one box, it should be disabled in the second box. My first select box in my html...
Read more >Select - Ant Design
Select component to select value from options. When To Use. A dropdown menu for displaying choices - an elegant alternative to the native...
Read more >MDB Select - disabled option functionality not working
It works properly meaning the option becomes disabled when you initialize the data with disabled=true.However, I am not able to achieve that behavior ......
Read more >react-select: An introduction - LogRocket Blog
Our react-select component follows the same convention but the options and values are passed in as props. //App.js //Import React and Select ......
Read more >Disabling Form Controls When Working With Reactive Forms ...
You can enable/disable a form control by using the following ways: ... Let's Talk About Select and Reselect in @ngrx/store.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think it makes perfect sense for
Select
to check if theselect
element and its options are enabled, but only when interaction is requested on these elements. Aselect
does have a selection when its disabled. The original request was about not being able to select disabled options, which seems like a valid request to me. The change does not implement that request. It is still possible to select disabled options, but now it is no longer possible to instantiate aSelect
when theselect
is disable at that moment. Even worse, it is now possible to operate on a disabledselect
, when it is disabled after instantiation of theSelect
. This wasn’t possible before.This change broke our tests, because we use
Select
to read the selected value of aselect
. In some cases the element is disabled. I had to change the code like this, which is not an improvement IMHO:@titusfortner, @asolntsev I have a variant of the problem noted by @volnoboy-broadcom; I just want to examine the value of a disabled <select>, and the NotImplementedError(“Select element is disabled and may not be used.”) in the constructor prevents this. I too would like this part of 0eb286a8fd of reverted/redone.