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

Buttons need to be tapped twice in order to fire the click event (iOS) #385

Closed
1 task done
AndyOGo opened this issue Apr 4, 2018 · 9 comments
Closed
1 task done

Comments

@AndyOGo
Copy link

AndyOGo commented Apr 4, 2018

Are you reporting a bug or a feature?

  • Bug

Expected Behavior

Buttons should trigger click upon single taps.

Actual Behavior

<axa-button>'s do only fire click upon second tap. It seems that only those <axa-button> are affected which use the <button> tag internally. It seems that:

  1. first tap trigger :hover state
  2. second tap triggers click event

Steps to Reproduce the Problem

  1. goto https://axa.ch/en/private-customers/offers/property-living/household-contents.html
  2. scroll to next expandable container

ios-11-button-double-tap

Specifications

TL/DR: just paste results from https://www.whatsmybrowser.org/

Please provide any relevant information about your setup - os, browser, node, npm, etc.

  • Browser: iOS Safari, Chrome on iOS

Same Bugs in other repos

Good explanations of what is going mad in iOS

Possible Solutions

@AndyOGo
Copy link
Author

AndyOGo commented Apr 4, 2018

@AndyOGo
Copy link
Author

AndyOGo commented Apr 5, 2018

@LucaMele
Basically the issue is that Apple decided years ago, that they want to make sure :hover content is visible. Hence they went for 1. tap -> :hover, 2. tap -> click.

So far I found the following possible fixes:

  • Using CSS @supports() to target iOS (problem it may only work for iOS 9+)
  • Utilize interaction media queries @media (hover: hover/none) { ... } (problem they aren't dynamic and browser support is grap 😱)
  • Add is-touch / no-touch root classes by Javascript (problem we want to deliver zero specificity and this needs special JS code)
  • Handle touch events by ourselves and trigger click artificially -> tap event PR Feature/add tap event #290
  • Try to avoid invisible ::after content if not :hover

@AndyOGo
Copy link
Author

AndyOGo commented Apr 17, 2018

@LucaMele
this should be fixed, right?

@LucaMele
Copy link
Contributor

yes i think so.. but we have not tested it yet on ACC right?

@AndyOGo
Copy link
Author

AndyOGo commented Apr 17, 2018

Okay, on my iPhone it's still broken at ACC.
Are we sure that it's released and that all cache layers are pruned?
Because I tested it really heavy...

@LucaMele
Copy link
Contributor

did we merge it on master the fix?

@AndyOGo
Copy link
Author

AndyOGo commented Apr 17, 2018

Sure, as a hotfix and it was tagged too as 2.0.1-beta.121:
screen shot 2018-04-17 at 17 49 47

@AndyOGo
Copy link
Author

AndyOGo commented Apr 17, 2018

I just pruned the caches at ACC and it works now on my iPhone 😃

@AndyOGo
Copy link
Author

AndyOGo commented May 3, 2018

Released and working at prod of axa.ch

@AndyOGo AndyOGo closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants