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

Support reverse scrolling in iOS Safari #165

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Support reverse scrolling in iOS Safari #165

merged 1 commit into from
Oct 15, 2023

Conversation

inokawa
Copy link
Owner

@inokawa inokawa commented Aug 30, 2023

close #43

This PR will change jump compensation behavior in iOS WebKit browsers.

@inokawa inokawa force-pushed the ios-safari branch 3 times, most recently from 12e4050 to a4247a8 Compare September 9, 2023 17:06
@inokawa inokawa force-pushed the main branch 3 times, most recently from b91df5c to 257e20b Compare October 8, 2023 16:13
@inokawa inokawa force-pushed the ios-safari branch 2 times, most recently from 828206d to dfa2f0a Compare October 14, 2023 14:50
@inokawa inokawa changed the title Defer applying jump to scroll position in iOS Safari Support reverse scrolling in iOS Safari Oct 15, 2023
@inokawa inokawa force-pushed the ios-safari branch 2 times, most recently from 19f479c to 1334b1e Compare October 15, 2023 08:30
@inokawa inokawa marked this pull request as ready for review October 15, 2023 09:26
@inokawa inokawa merged commit 3747796 into main Oct 15, 2023
2 checks passed
@inokawa inokawa deleted the ios-safari branch October 15, 2023 10:19
@oleggrishechkin
Copy link

Hi, @inokawa. Sorry for writing in this closed PR, but did you find any pretty solution to fix iso safari scrolling?
In my library (also virtualization) I'm using negative or positive margin-top hack to make scroll compansation on new item render/item size change.

Oh... why ios safari uses this awful technic and nobody fixed this at the end of 2023...

@inokawa
Copy link
Owner Author

inokawa commented Dec 28, 2023

Yes, it's very sad behavior in iOS Safari... My approach is not perfect but doing my best.

As you probably know, we can't change scroll position in iOS Safari during momentum scrolling or touching so I compensate it with adding offset to top(similar to margin).
I want to revert it and fix scroll position after a while. However I couldn't find reliable way to know when Safari started accepting scroll position change. In such timing that may be ok or may not be ok,
a workaround like https://github.com/prud/ios-overflow-scroll-to-top is used.

@oleggrishechkin
Copy link

Yes, it's very sad behavior in iOS Safari... My approach is not perfect but doing my best.

As you probably know, we can't change scroll position in iOS Safari during momentum scrolling or touching so I compensate it with adding offset to top(similar to margin).

I want to revert it and fix scroll position after a while. However I couldn't find reliable way to know when Safari started accepting scroll position change. In such timing that may be ok or may not be ok,

a workaround like https://github.com/prud/ios-overflow-scroll-to-top is used.

Thank you. Nice emulation of smooth/momentum scrolling. It may help me with my research and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve behavior in iOS Safari
2 participants