MudBlazor/MudBlazor

Add option to scroll to top on page change in MudDataGrid

Open

#11 212 ouverte le 20 avr. 2025

Voir sur GitHub
 (1 commentaire) (3 réactions) (0 assignés)C# (1 631 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (10 394 stars)
Métriques de merge PR
 (Merge moyen 6j 6h) (108 PRs mergées en 30 j)

Description

Feature request type

Enhance component

Component name

MudDataGrid

Is your feature request related to a problem?

I'm always frustrated when navigating through pages in MudDataGrid with a large number of rows. The scrollbar stays at the same position, making it difficult to view the new page's content from the top. need to scroll each time navigating back to top of page. this issue was raised by many users in my company, I solved it alone with simple few lines of code using javaScript, but it will be nice if it would be the default or at least be given as an option when using the component.

Describe the solution you'd like

I would like to propose an enhancement to the MudDataGrid component to automatically scroll to the top when changing pages. This feature should be configurable, allowing users to choose whether they want the scrollbar to reset to the top or remain in its current position. This would improve usability, especially when dealing with large datasets.

Have you seen this feature anywhere else?

This feature is commonly seen in various data grid implementations where navigating through pages automatically resets the scroll position to the top, enhancing user experience.

Describe alternatives you've considered

An alternative solution is to manually implement JavaScript interop to scroll the MudDataGrid element to the top on page change. However, having this feature built into the component and configurable would be more user-friendly and efficient.

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guide contributeur