Skip to content
New issue

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

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

Already on GitHub? # to your account

bug: Doesn't work in Chrome simulator when choosing any iPhone #83

Open
mrleblanc101 opened this issue Oct 29, 2024 · 7 comments
Open
Labels
bug Something isn't working

Comments

@mrleblanc101
Copy link

mrleblanc101 commented Oct 29, 2024

I was testing the demo and it was working on desktop, but not on mobile.
I finally realized, that when using the "iPhone" preset in Chrome, it changes the user-agent and the scroll lock doesn't work (it doesn't add the style attribute to the body or html).

2024-10-29 13 22 27

If I change for Nexus 5 (or any android device), the scroll lock works.

2024-10-29 13 23 09

@mrleblanc101 mrleblanc101 added the bug Something isn't working label Oct 29, 2024
@BuptStEve
Copy link
Member

When you choose iPhone, you should use touch events, rather then scroll events.
How could you use mouse wheel events on your iPhone?

@mrleblanc101
Copy link
Author

It should still work, at least https://bodyscrolllock.vercel.app/ does

@BuptStEve
Copy link
Member

We'll think about it...

@BuptStEve
Copy link
Member

Maybe we add an option, like setOverflowForIOS: true to enable bsl in Chrome simulator? @mrleblanc101

@BuptStEve
Copy link
Member

tua-body-scroll-lock@1.6.0-beta.1

@mrleblanc101
Copy link
Author

@BuptStEve Why another option ? I think overflowType should be respected everywhere unless it creates other problems ? I had some other issue with overflow: hidden and position: sticky but I sadly I couldn't reproduce from my limited memory, maybe they already got fixed since my message last year.

@BuptStEve
Copy link
Member

@BuptStEve Why another option ? I think overflowType should be respected everywhere unless it creates other problems ? I had some other issue with overflow: hidden and position: sticky but I sadly I couldn't reproduce from my limited memory, maybe they already got fixed since my message last year.

Yeah, we need a reproduction demo to test functionality.
Added a new option for compatibility reasons.
2.0 will change some default options.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants