Using has/get/setAttribute does not work correctly for checked state of input
Reported by
bengfarr...@gmail.com,
Dec 22 2017
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
Steps to reproduce the problem:
1. Add a checked state via JS setAttribute('checked', true)
2. Remove the checked state by clicking the checkbox
3. Click the checkbox to "checked" state
4. Try to Remove the checked state via JS removeAttribute('checked')
What is the expected behavior?
In Firefox, set/removeAttribute for checked via JS doesn't appear to work at all. The preferred method of setting .checked works flawlessly anywhere (as it should)
In Chrome's situation, using set/removeAttribute works, but only until the user interacts directly by clicking the input checkbox. Once user interaction occurs, the JS attribute API won't work at all.
This behavior sets the false expectation that the attribute API will work all the time.
What went wrong?
Having it working and then not working once user interaction occurs is very confusing
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 63.0.3239.84 Channel: stable
OS Version: 10.0
Flash Version:
,
Dec 22 2017
Per comment#1, closing this as WontFix.
,
Dec 22 2017
Hmm, maybe worth looking at this in terms of interop with Firefox.
,
Dec 27 2017
,
Jan 9 2018
I confirmed Safari TP, and Firefox 58.0a1 have the same behavior with Google Chrome.
,
Jan 9 2018
Thanks for looking into this. I just tried in FF again, and that behavior is the same (as in I'm seeing the same as tkent). I'm not sure if I was mistaken, or if the version of FF I was using at the time did something different. Either way, I still feel like it's counter intuitive behavior, but the spec says what it says. I don't necessarily care that it gets fixed, just wanted to prevent similar confusion for someone else. Thanks again |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by woxxom@gmail.com
, Dec 22 2017