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

Scroll Snapping not working #12

Open
Rosinida opened this issue Aug 28, 2022 · 18 comments
Open

Scroll Snapping not working #12

Rosinida opened this issue Aug 28, 2022 · 18 comments
Labels
blocked enhancement New feature or request

Comments

@Rosinida
Copy link

Hi, i tried to add scroll-snapping to my HTML and it worked!
But sadly there is an issue while using scroll-snap-align: start;
It always jumps without animation to my next section.
https://css-tricks.com/practical-css-scroll-snapping/#aa-example-3-vertical-full-screen

Can you fix that?

(Love your code!)
Thanks Robin

@clementroche
Copy link
Member

Hi @Rosinida thank you for your feedback, can you provide a live demo (ideally on codepen or codesandbox) ?

@Rosinida
Copy link
Author

Hi @clementroche sure, just made a very simple codepen demo for you. – hope this helps!
https://codepen.io/rosinida/pen/BargMXG
Thanks Robin

@clementroche clementroche added the bug Something isn't working label Aug 31, 2022
@Rosinida
Copy link
Author

Rosinida commented Sep 6, 2022

Hi @clementroche.
Is there a workaround to define a minimum scroll distance?
(as long as the scroll snapping doesn't work yet)

@clementroche
Copy link
Member

clementroche commented Sep 6, 2022

What do you mean by minimum scroll distance ? You mean emulate CSS scroll snap ?

@Rosinida
Copy link
Author

Rosinida commented Sep 6, 2022

Yes. I would like to say: Each scroll should get the same scroll distance (for example 100vh)

@harshilsharma63
Copy link

Any update on this? I'm facing the same issue - Lenis smooth scroll and CSS snap scroll doesn't work together very well.

@clementroche
Copy link
Member

clementroche commented Sep 29, 2022

It seems like the solution would be to emulate scroll snapping using JavaScript and that's something we want to avoid. So for the moment i would advice you to not use Lenis if you need CSS snap scroll.

@harshilsharma63
Copy link

Thanks for the update.

@liqueflies
Copy link

liqueflies commented Nov 4, 2022

Investigating: setting the wrapper and the content it will scroll but not interpolating with css easing of the snap.
I think this could be a neverending issue.

EDIT: Solving this to me is like solving and improving accessibility of those king of scroll hijacking where you have to wait before triggering another scroll. what a dream :D

@clementroche clementroche added enhancement New feature or request blocked and removed bug Something isn't working labels Dec 2, 2022
@drewbaker
Copy link

It seems like the solution would be to emulate scroll snapping using JavaScript and that's something we want to avoid. So for the moment i would advice you to not use Lenis if you need CSS snap scroll.

So stoked to see this library... Really like the approach. Scroll Snap is certainly something we need a lot. Would you be open to a PR trying to implement this? Or is this just a "hard no" that you don't want us to even try?

@clementroche
Copy link
Member

Of course we're open to a PR !

@drewbaker
Copy link

Noting a possible solution to consider https://github.com/ocsal/scroll-snap

@rsm0128 rsm0128 mentioned this issue Jan 14, 2023
@rsm0128
Copy link

rsm0128 commented Jan 14, 2023

Hi @drewbaker, Here is a PR for scroll snapping. It emulates scroll snapping by using JavaScript.

@clementroche
Copy link
Member

Hey you can try https://github.com/funkhaus/lenis-scroll-snap

@sushanyadav
Copy link

Hey you can try https://github.com/funkhaus/lenis-scroll-snap

Is this available for react wrapper. if so how do we use it? Thank you so much.

@clementroche
Copy link
Member

clementroche commented Apr 18, 2023

it should, react-lenis gives you the lenis instance as ref or using useLenis so you just need to plug it then.

@sushanyadav
Copy link

It would be greatly appreciated if somebody could include a sandbox for this. 🙏

@clementroche
Copy link
Member

hey @Rosinida you can try lenis/snap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants