- ABP Framework version: v7.0
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:" When open new page, system still keep previous position. I want to it reset page to top, how can I do that?
14 Answer(s)
-
0
hi
You can try to call the javascript function to scroll to the top on
LocationChanged
event.https://blazor-university.com/routing/detecting-navigation-events/ https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.navigationmanager.locationchanged?view=aspnetcore-7.0
-
0
Thank you, What is component or page I should overwrite to add this script? I dont know which component will be called when any page loaded
-
0
hi
You can try to add a Layout-Hooks
https://docs.abp.io/en/abp/latest/UI/Blazor/Layout-Hooks
-
0
-
0
What's your code?
-
0
-
0
hi
Try to rename your class as
ScrollToTopComponent
-
0
Hi, it is same error, I just change name to exact name AnnouncementComponent but not work as well
-
0
hi
I will test this.
-
0
hi
Can you share your project? liming.ma@volosoft.com
-
0
Yes i just add component and add it to ConfigureServices Please have a look at my change
-
0
hi This is an app issue, we will fix the scroll issue in the next patch release.
-
0
Thank you, waiting for hearing update from you
-
0
We will solve the problem as soon as possible