Checkboxradio: Clicking on an unnamed radio button must also work #7082
Conversation
Adds tests for <commitid>. Closes gh-7082
@arschmitz I would suggest that, for 1.4.1, we apply the fix as is. It is no less accurate than what we've had so far, so it shouldn't introduce any regressions. We should construct a scenario where the radios are grouped incorrectly, and we should file a separate issue against that. |
@gabrielschulhof while you are correct that its no less wrong, I'm hesitant to change a line we know is incorrect. If it was more separate i would agree however this effects the same line. Also the fix is fairly simple
This makes sure that each element in the set has the same formParent as the widget does which is the correct behavior according to spec. |
@gabrielschulhof I would also argue this is all really the same issue in that the real issue is that this statement returns an incorrect array of elements. I think we should update issue #7088 to reflect this fact. The issue with this function returning elements that that should not be in the same set just reflects this is a bigger issue then originally reported. My suggestion would be to fix this as I suggest above and add tests for different combinations where this would have previously failed.
|
After looking into it, I found some things:
We may wanna look into making use of |
The addition of page and dialog here is an intentional divergance from spec this was discussed and decided a long time ago when 5b8d806 was discussed. This is because the specs have no concept of pages but in out navigation system we treat each page likes its own document ( infact this is also how they are generally written even unless its a multi-page template ) so we decided page and dialog should stay. at the time body was not added because widgets outside pages were not supported yet. |
@arschmitz Here's a potential problem with that. |
So, based on our discussion I have removed the special handling of pages. Thus, the code for establishing the radio button group is now consistent with the spec. |
radio = this.element[ 0 ], | ||
name = radio.name, | ||
form = radio.form, | ||
doc = radio.ownerDocument, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the radio may not have an owner document in could be in a detached state
👍 |
Original commit message: Fixed a bug that the input type="radio" button without
the name attribute is not changed to the checked status when it is clicked.