Skip to content

Conversation

MichaelWest22
Copy link
Collaborator

@MichaelWest22 MichaelWest22 commented Jun 11, 2025

Description

The fix for a bug got stalled in #2771 so doing it again to address this bug.

The bug that was found is that if you use the from: syntax in a trigger to listen on another element like body for events it still uses the source element for making the decision on if a click event will get canceled/prevented to avoid it firing default form/link behaviour. This can cause all click events to be blocked on checkboxes and other elements in error when only valid form submits or certain link clicks should be prevented. So this fix changes it to use the events target for deciding which element types to prevent and it falls back to the source element if the event target is not valid.

Corresponding issue:
#2755

Testing

Did some manual testing and ran test suite and implemented tests from the original PR

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants