Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event target #391

Merged
merged 4 commits into from
Aug 4, 2021
Merged

Fix event target #391

merged 4 commits into from
Aug 4, 2021

Conversation

roderickhsiao
Copy link
Collaborator

@roderickhsiao roderickhsiao commented Aug 4, 2021

  1. In click handler we directly check if the target node is button/anchor, this should be currentTarget instead of target or else some case like keyboard enter for a button component will not identify as button as the target will be the child.
  2. We only check if a button tag has form and submit it by default without checking the type of the button. If a button (with type button specified), javascript will still attach form object to the element, but browser won't auto submit it when clicking it. To align with the browser behavior, I'm adding check to prevent auto-submit parent form if the button type is not submit (default)

All child component for auto scan case should already attached different listeners. (we are not using capture in the click handler)


I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@roderickhsiao roderickhsiao deleted the fix-event-target branch August 4, 2021 21:07
@roderickhsiao roderickhsiao reopened this Aug 4, 2021
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.

None yet

2 participants