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
Click event on label should be prevented if its child input element is disabled #6949
Comments
Thank you for this information! I've reproduced this issue. |
Thanks for the prompt response/prioritization! One more situation that causes this issue: <label for="peas-input">Do you like peas?</label>
<input id="peas-input" type="checkbox" disabled name="peas"> |
Thank you for the additional information. It is very helpful. |
Please also take a look at #2902 |
I believe this issue relates also to a following scenario where you have link inside checkbox label. E.g. in my case I have following piece of html:
Clicking that link manually with Firefox or Chrome won't check that checkbox. When running tests with Testcafe & Chrome checkbox gets checked from clicking that link. Same won't happen with Testcafe & Firefox. |
…nk located inside the label is clicked(closes DevExpress#6949)
…nk located inside the label is clicked(closes DevExpress#6949)
…ckbox label is clicked(closes DevExpress#6949)
…ckbox label is clicked(closes DevExpress#6949)
Related to DevExpress/testcafe-hammerhead#1880, where a fix was added to prevent mouse events on elements that have the
disabled
attribute set (or that have an ancestor for which it's set).There's an edge case which wasn't considered: it's semantically correct to have a
<label>
element which contains its relatedinput
element, and in this case mouse events on the<label>
should be prevented if the input isdisabled
.Example:
In TestCafe 1.0.0 (hammerhead
14.4.12
based on mypackage-lock.json
), this works as expected in Chrome, Edge and IE, but Firefox incorrectly triggers a click event on a label such as the one above. Firefox does not do this when manually clicking the label, so it's specific to Hammerhead.The text was updated successfully, but these errors were encountered: