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 2 years 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

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.

codesandbox-ci[bot] avatar May 11 '23 22:05 codesandbox-ci[bot]

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

sean6bucks avatar Jul 03 '23 20:07 sean6bucks

:tada: This PR is included in version 14.6.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Jan 21 '25 17:01 github-actions[bot]

Should there be an error or warning instead of just ignoring the click?

filipw01 avatar Mar 17 '25 09:03 filipw01