user-event icon indicating copy to clipboard operation
user-event copied to clipboard

fix: prevent click event on non-focusable control

Open a0js opened this issue 1 year ago • 2 comments

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.

a0js avatar May 11 '23 22:05 a0js