You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
tabs(pagination): adding a new tab on mobile causes two tabs to be created #11725
What is the use-case or motivation for changing an existing behavior?
It's a bug.
Which versions of AngularJS, Material, OS, and browsers are affected?
AngularJS: 1.7.6
AngularJS Material: 1.1.19 (HEAD)
OS: Android 9, iOS 12.2
Browsers: Chrome for Android 73, iOS Safari
Is there anything else we should know? Stack Traces, Screenshots, etc.
This only happens on mobile with Chrome and Safari.
This does not occur on Firefox for Android.
This does not occur on Chrome, Safari, or Firefox for macOS, but there is a bit of a flicker to the animation that almost looks like a second tab is added and removed quickly on Safari and Firefox.
This can be reproduced in the Chrome DevTools mobile emulator
This appears to be caused by eecc541 which made a change to gesture handling. Using $mdGestureProvider.skipClickHijack(); in your application's config seems to work around this issue.
While MouseEvent.clientX and MouseEvent.clientY are 0 for Enter key submit events in Chrome, they are set to values matching the actual position of the mouse/touch on iOS.
The workaround in eecc541, only helps fix the case where the event is dispatched by an element with type="submit" like when pressing Enter in an input field on a form with a submit button. However, it doesn't keep the clickHijacker from capturing and stopping propagation on other iOS key presses that generate click events.
It's not clear how we can differentiate click events that were triggered by a "KeyClick" and those that were not on iOS. The only difference that I can see between the two events is the webkitForce value being 1 on a button press and 0 on the Enter key.
I tried out the webkitForce workaround and it seems to work well on iOS and Android, but needs some additional testing from the community. Please try out this branch (https://github.com/angular/material/tree/gesture-fixDoubleSubmit) and provide feedback.
Tested on
Firefox
Chrome
Chrome for Android
iOS Safari
macoS Safari
I'll try to get a PR up for this tomorrow, but I need to
add checks for browser support of new MouseEvent() and new CustomEvent() and fallbacks
Activity
Splaktar commentedon May 18, 2019
This is reproducible on the 1.1.11 tabs demo.
Splaktar commentedon May 18, 2019
Actually, I didn't go back far enough. This is reproducible in the
1.1.6tabs demo.Splaktar commentedon May 18, 2019
And with some more testing, I was able to reproduce this as far back as
1.1.4.Splaktar commentedon May 18, 2019
This appears to be caused by eecc541 which made a change to gesture handling. Using
$mdGestureProvider.skipClickHijack();in your application'sconfigseems to work around this issue.Splaktar commentedon May 18, 2019
Lots of related discussion in #3990 and PR #10189.
Splaktar commentedon May 20, 2019
It looks like the "fix" in eecc541 was to work around the fact that our
isKeyClicklogic does not work on iOS Safari:material/src/core/services/gesture/gesture.js
Lines 592 to 593 in ecf1705
While
MouseEvent.clientXandMouseEvent.clientYare0for Enter key submit events in Chrome, they are set to values matching the actual position of the mouse/touch on iOS.The workaround in eecc541, only helps fix the case where the event is dispatched by an element with
type="submit"like when pressing Enter in an input field on a form with a submit button. However, it doesn't keep theclickHijackerfrom capturing and stopping propagation on other iOS key presses that generateclickevents.We have the same bad check in
material/src/core/services/gesture/gesture.js
Lines 577 to 578 in ecf1705
It's not clear how we can differentiate
clickevents that were triggered by a "KeyClick" and those that were not on iOS. The only difference that I can see between the two events is the webkitForce value being1on a button press and0on the Enter key.fix(gesture): tapping a submit button fires two submit events on mobile
Splaktar commentedon May 20, 2019
I tried out the
webkitForceworkaround and it seems to work well on iOS and Android, but needs some additional testing from the community. Please try out this branch (https://github.com/angular/material/tree/gesture-fixDoubleSubmit) and provide feedback.Tested on
I'll try to get a PR up for this tomorrow, but I need to
new MouseEvent()andnew CustomEvent()and fallbacksfix(gesture): tapping a submit button fires two submit events on mobile
fix(gesture): tapping a submit button fires two submit events on mobile
fix(gesture): tapping a submit button fires two submit events on mobile
fix(gesture): tapping a submit button fires two submit events on mobi…