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

Lazy initialization of library breaks click on iPhone #1246

Open
mihalikv opened this issue May 15, 2023 · 5 comments
Open

Lazy initialization of library breaks click on iPhone #1246

mihalikv opened this issue May 15, 2023 · 5 comments
Labels
Support Questions and other support issues

Comments

@mihalikv
Copy link

mihalikv commented May 15, 2023

Expected Behavior

When I click on "Go to google", browser should redirect to the root.cz.

Current Behavior

When I click on "Go to google", I am still on same page.

Steps to Reproduce

https://jsfiddle.net/v7axdwLm/2/ -> Click on link on iPhone

This is very specific case when there is some custom event listener on document but I can't figured out why noUiSlider should break simple link redirect. Maybe my custom init script is wrong...

Context (Environment)

Tested on real device and also in browserstack
image

Possible Implementation

I tried to change code of adding event listeners in various way and this change helped but it definitely break rest of the lib
image

@leongersen
Copy link
Owner

The lazy init seems to work fine for me, if you click elsewhere in the document.

The reason the Jsfiddle does not navigate is unrelated:

Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

@mihalikv
Copy link
Author

I changed jsfiddle the link in issue https://jsfiddle.net/v7axdwLm/2/

@mihalikv
Copy link
Author

mihalikv commented May 15, 2023

RPReplay_Final1684146671.MP4

Recording from real iPhone. You basically need to click twice.

@leongersen
Copy link
Owner

I don't think that's related to noUiSlider.

@mihalikv
Copy link
Author

mihalikv commented May 15, 2023

Yeah it's not related to noUiSlider, it's more like noUiSlider is affected by some of the conventions of safari/iPhone. When you add an element dynamically and then attach the event to it, it will affect clicking anywhere else on the page.

Here is minimal reproduction without noUIslider: https://jsfiddle.net/1ktyhfev/10/
and here is the "fixed" version with setTimeout: https://jsfiddle.net/1ktyhfev/11/

I test it also with "fix" in noUiSlider and it works for me
image

Unfortunately, I cannot find any related articles about this kind of bug.
Maybe this is related in some way angular/angular#50230

@leongersen leongersen added the Support Questions and other support issues label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Questions and other support issues
Projects
None yet
Development

No branches or pull requests

2 participants