user-event
user-event copied to clipboard
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.