fix: prevent click event on non-focusable control
What:
Resolves #1057. This change stops click events from being forwarded to non-focusable inputs from labels.
Why:
Currently, click events are being forwarded to inputs from labels. This is expected behavior unless the input is disabled or hidden or otherwise not focusable. This behavior break tests that rely on clicking labels of disabled inputs.
How:
The function call forwarding the click was moved inside the conditional checking if the control was focusable.
Checklist:
- [N/A] Documentation
- [x] Tests
- [x] Ready to be merged
Also, updating the "How to Contribute" egghead tutorial link in CONTRIBUTING.md.
Based on @nknapp's suggestion.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Is this waiting on contributor updates or for TL team to approve? Would love for this to get implemented, as currently blocking us from using 14.x
:tada: This PR is included in version 14.6.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Should there be an error or warning instead of just ignoring the click?