You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Blazor automatic scrolling to top on navigation does not work. JavaScript functions to scroll to top does not work. Happens when blazor.bootstrap.css is included. 100% reproducable. No errors in browser console or Visual Studio.
To Reproduce
Create a new project
Blazor WebAssembly Standalone App
Framework = .NET 8.0
Run the application
Go to counter page
Scroll down
Click on "Selact A"
The address is changed and the page scrolls to the top
Scroll to bottom
Open developer tools in the console and go to the console
Type "document.documentElement.scrollTop = 0"
The page scrolls to the top
Scroll to bottom
Type "window.scrollTo(0, 0)"
The page scrolls to the top
Close the application
Describe the bug
Blazor automatic scrolling to top on navigation does not work. JavaScript functions to scroll to top does not work. Happens when blazor.bootstrap.css is included. 100% reproducable. No errors in browser console or Visual Studio.
To Reproduce
Create a new project
Blazor WebAssembly Standalone App
Framework = .NET 8.0
Replace the content in Counter.razor with:
Run the application
Go to counter page
Scroll down
Click on "Selact A"
The address is changed and the page scrolls to the top
Scroll to bottom
Open developer tools in the console and go to the console
Type "document.documentElement.scrollTop = 0"
The page scrolls to the top
Scroll to bottom
Type "window.scrollTo(0, 0)"
The page scrolls to the top
Close the application
Install NuGet Blazor.Bootstrap according to the instructions at https://docs.blazorbootstrap.com/getting-started/blazor-webassembly-net-8
I am using stable version 2.2.0, also tested with 3.0.0-preview.2
Run the application
Repeat the actions in the browser
Note that it never scrolls to top
Close the application
In index.html, remove the link to "_content/Blazor.Bootstrap/blazor.bootstrap.css"
Run the application
Repeat the actions in the browser
Scrolling works again
Expected behavior
Scrolling should not be affected by using blazor.bootstrap.css.
Screenshots
Versions (please complete the following information):
Sample code
GitHub repo
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: