-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Reset scroll position after navigation. Fixes #10482 #12423
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
Reset scroll position after navigation. Fixes #10482 #12423
Conversation
5fbcddc
to
cd85731
Compare
Browser.Equal(0, () => BrowserScrollY); | ||
} | ||
|
||
private long BrowserScrollY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of confusing. I would have simply used methods for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great change!
Straightforward and with E2E, nice!
cd85731
to
1d4be1e
Compare
1d4be1e
to
4bc6696
Compare
I think there is a problem with this approach , you see, I have a collapse component in my page and it is kind of in the bottom of the page . when i toggle a tab within my component , the normal behavior for page in this situation is not to scroll and stay put since i have inner page link ( starts with # ) in href attribute of my "a" tag. |
Agree with @kaveh6202
For us the workaround was overriding the default behavior with an interop method:
|
Hi @smirceamihai. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
for anyone who stumbled this on .NET 7
|
Hi @christallire. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
This only affects link clicks and programmatic navigation.
For back/forwards, browsers already apply their own native scroll position restoration behavior, which varies between browsers, so we leave that alone.