Odd Navigation State Occurs in Blazor InteractiveServer When Using Back and Forward Navigation Buttons
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
I have been spending the day tracking this down and am going to report my findings here. I am encountering a weird scroll state issue when using the forward/back buttons in `InteractiveServer` pages.
I have been able to reproduce this using a Hello World application here:
https://github.com/Mike-E-angelo/Stash/tree/master/Blazor.Navigation
I have modified a Blazor hello world sample by providing enough content to scroll on both the Home and Counter screens.
When navigating directly between these screens by pressing navigation links in the primary navigation menu, everything works perfectly as expected. ✅
However, when you start at Home, navigate to Counter via navigation, scroll, navigate away using the back button (on mouse or browser), then navigate forward, the scroll state is not as expected (what it last was) with the Counter page.
### Expected Behavior
Scroll state of each page is consistently maintained when navigating via forward/backward in the browser.
### Steps To Reproduce
1. Start at Home
2. Press Counter
3. Scroll to bottom (or near bottom)
4. Press Back to return to Home
5. Press Forward to return back to Counter
6. Observe scrollbar is not where it was when you left it at step 3:
### Exceptions (if any)
NA
### .NET Version
10.0.300
### Anything else?
Thank you very much for all your excellent work on this amazing technology. 🙏
Contributor guide
Assessment
This issue has not been assessed yet.