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

Working on full HTML page only. #2

Open
pavel-klavik opened this issue Dec 22, 2019 · 3 comments
Open

Working on full HTML page only. #2

pavel-klavik opened this issue Dec 22, 2019 · 3 comments

Comments

@pavel-klavik
Copy link

It currently only works on the full element. In my website, I have a top panel which is always visible and the scroll area is below it. It would be great to allow clerk to be set on a custom element (both watching updates of scroll position and updating the scroll position after change of route).

@PEZ
Copy link
Owner

PEZ commented Dec 22, 2019

Indeed. I used an adapted Clerk in a project where I used an offset to compensate for a sticky top menu. Not exactly the same, granted, but anyway, I agree there should be some way to use vanilla Clerk with something else than full page apps.

The reason I didn't adapt Clerk to support my offset use case was that I didn't figure out a good API for it. So, here's a question back to you: What API would you prefer use for your use case? It will need to be backwards compatible with the current API, I think.

@pavel-klavik
Copy link
Author

Maybe let the user handle the events on their own when they need it?

So instead of running install-scroll-saver, one could bind this (or some modified function) to on-scroll event of any element. Here, it would need get the scroll position of an element, no the entire document.

Concerning scrolling, it could be caused on arbitrary element. I would just add optional argument to navigate-page!, on which element you want to cause the scroll.

@PEZ
Copy link
Owner

PEZ commented Mar 7, 2022

Seems I dropped this ball, right? No idea what happened back then, maybe Christman... Anyway, now reading your suggestion again and think it makes sense.

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

No branches or pull requests

2 participants