-
-
Notifications
You must be signed in to change notification settings - Fork 683
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 "scroll" prop to <A> #2666
Comments
I was looking into implementing this and it looks like it does detect a leptos/router/src/components/router.rs Line 474 in b3db094
We probably should either document this somewhere or make a prop on |
Ah. Probably because it's not an actual HTML attribute, and we do check those now. I'm open to ideas. One easy one would be to support |
Yeah that makes sense, either that or take a component prop. Component prop would be more self documenting, but probably not worth much extra effort if a data attr is easier. For my project I think I need to hold off on upgrading for a bit, so no rush from me. I've got some custom components I need to rework which will make upgrading easier in the future. I can work on a PR for noscroll eventually if no one beats me to it. |
I think I added a |
Is your feature request related to a problem? Please describe.
I would like to have a table that has pagination buttons that are proper links and set the
?page=X
query parameter. Unfortunately this causes it to scroll to the top of the page when clicked. Because the table isn't at the top of the page, it's jarring and annoying to have to scroll down to the table again every time.Describe the solution you'd like
I'd like to be able to pass
scroll=false
to Leptos'<A>
component to tell it not to scroll to the top of the page when navigating.Describe alternatives you've considered
I've considered just using on:click and use_navigate but that's discouraged because it isn't as accessible according to the Leptos book:
Additional context
I looked up how this was done in the React world for inspiration and here they have a
scroll
property on their<link>
component: https://nextjs.org/docs/pages/api-reference/components/link#scrollThe text was updated successfully, but these errors were encountered: