Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(gesture): tapping a submit button fires two submit events on mobile #11729

Merged
merged 1 commit into from
May 30, 2019

Conversation

Splaktar
Copy link
Contributor

@Splaktar Splaktar commented May 23, 2019

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

  • Ever since eecc541 in 1.1.4, tapping a submit button fires two submit events on mobile. This causes the dynamic tabs demo w/ pagination to often add two tabs for each 'Add Tab' button click on iOS and Android.
    • when click hijacking is enabled (default)
      • isKeyClick check did not work on iOS since clientX/Y are set
  • Our gesture code is using the deprecated initMouseEvent and initCustomEvent

Issue Number:
Fixes #11725

What is the new behavior?

when click hijacking is enabled (default)

use recommended new MouseEvent() and new CustomEvent()

  • fallback to deprecated methods initMouseEvent() and initCustomEvent()

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Tests could not be added as we have not test infrastructure for Android and iOS.

Tested on

  • Firefox
  • Chrome
  • Chrome for Android
  • iOS Safari
  • macoS Safari
  • IE11
  • MS Edge
  • MS Edge Chromium

More info on creating and triggering events can be found on MDN.

@Splaktar Splaktar added type: bug ui: mobile browser: Safari os: iOS This issue is specific to iOS browser: Chrome severity: regression This issue is related to a regression P1: urgent Urgent issues that should be addressed in the next minor or patch release. os: Android The issue is specific to the Android OS. labels May 23, 2019
@Splaktar Splaktar added this to the 1.1.19 milestone May 23, 2019
@Splaktar Splaktar self-assigned this May 23, 2019
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label May 23, 2019
@Splaktar Splaktar added pr: merge ready This PR is ready for a caretaker to review g3: sync labels May 23, 2019
@Splaktar Splaktar assigned andrewseguin and unassigned mmalerba May 30, 2019
this causes the dynamic tabs demo w/ pagination to often add two tabs
  for each 'Add Tab' button click on iOS and Android
when click hijacking is enabled (default)
- isKeyClick check did not work on iOS since clientX/Y are set
- add an iOS-specific isKeyClick check
- revert workaround from PR #10189
use recommended `new MouseEvent()` and `new CustomEvent()`
- fallback to deprecated methods `initMouseEvent()` and `initCustomEvent()`

Fixes #11725
@Splaktar Splaktar force-pushed the gesture-fixDoubleSubmit branch from 75960f6 to f6f4848 Compare May 30, 2019 21:47
@Splaktar
Copy link
Contributor Author

@andrewseguin rebased.

@andrewseguin andrewseguin merged commit 244619a into master May 30, 2019
@Splaktar Splaktar deleted the gesture-fixDoubleSubmit branch May 30, 2019 22:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser: Chrome browser: Safari cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ os: Android The issue is specific to the Android OS. os: iOS This issue is specific to iOS P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review severity: regression This issue is related to a regression type: bug ui: mobile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tabs(pagination): adding a new tab on mobile causes two tabs to be created
4 participants