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

Add user scroll events on:scrollUp and on:scrollDown #20125

Closed
CrystalOnScript opened this issue Jan 2, 2019 · 4 comments
Closed

Add user scroll events on:scrollUp and on:scrollDown #20125

CrystalOnScript opened this issue Jan 2, 2019 · 4 comments
Assignees
Milestone

Comments

@CrystalOnScript
Copy link
Contributor

CrystalOnScript commented Jan 2, 2019

Describe the new feature or change to an existing feature you'd like to see

A way to dispatch events based on the user's scroll direction. This would be great for animations, such as a header that's removed when the user scrolls down and reappears when the user scroll up again. Might be nice to be able to put a range of scrolling: on:scrollUp.100vh.event for full screen scrolling and on:scrollUp.1vh.event for any user scroll interaction.

Describe alternatives you've considered

Original thought was to make it an event, but may not work as desired if needs to be attached to an existing element. Maybe work as <amp-scroll-tracker>?

@aghassemi
Copy link
Contributor

@CrystalFaith We were originally thinking to create a dedicated component for the scroll-direction-based sticky headers, but I like your proposal much better as it is generic and maybe useful for other cases as well. Aligns nicely with amp-position-observer pattern too.

@ampprojectbot ampprojectbot added this to the New FRs milestone Jan 9, 2019
@aghassemi
Copy link
Contributor

@nainar Lots of thumbs up on this request. Setting a P1

@nainar
Copy link
Contributor

nainar commented Jan 30, 2019

@aghassemi has added this to our Fixit week task list.

@alanorozco
Copy link
Member

Closing this in favor of #20881 unless anyone objects. Those interested in this feature can follow that issue instead. It has been prioritized so you folks can all expect it soon!

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

5 participants