Skip to content

Conversation

@MarcoBellini
Copy link

Summary

This PR addresses several issues related to Grid behavior, filter rendering, and UI interactions across the application. It includes bug fixes, rendering improvements, and enhancements to the user experience.

Fixes & Improvements

1. PageSize Selector Bug

Issue: Changing the page size from the selector at the bottom of the table (image) caused the value to reset to 10.

Fix: Introduced a new variable (pendingPageSizeChanging) to prevent the grid from resetting the page during component rendering.

Additional: Updated and corrected the logic inside OnPageSizeChangedAsync.

2. Grid Settings Not Reflected in HTML After Load

Issue: LoadGridSettingsAsync() correctly restored saved settings, but the UI did not reflect these restored values.

Cause: Blazor prerendering caused the initial UI state to display before filters were fully loaded.

Fix: Introduced an isColumnsLoading flag to show placeholders during prerendering and display the correct filter state once loading completes.

3. Checkbox Rendering Issues in Filters

Issue: Checkbox filters were not applying the “checked” state correctly even when set to true.

Fix: Added a new RenderFragment InputFilterTemplate() in GridColumnFilter.razor.cs to handle checkbox rendering cleanly.

4. Missing async / Incorrect Task Handling

Added missing async keywords in several methods within Grid.razor.cs.

Replaced return Task.CompletedTask with proper await usage to ensure asynchronous flow behaves as expected.

5. Mobile Navigation Menu Fix

Issue: In mobile view (sidebar and sidebar2), clicking on a menu item did not close the NavMenu.

Fix: Implemented automatic closing of the navigation menu after a user selects an item.

… async usage. Sidebar and Sibar2: fic mobile nav behavior

- Fixed page size reset issue when selecting PageSize from the table footer.
Introduced pendingPageSizeChanging to prevent page reset during rendering and corrected OnPageSizeChangedAsync.

- Fixed incorrect UI restore after LoadGridSettingsAsync.
Added isColumnsLoading to show a temporary placeholder during prerendering and render filters correctly afterward.

- Added InputFilterTemplate (RenderFragment) in GridColumnFilter.razor.cs to fix checkbox rendering where the checked state wasn’t applied properly.

- Added missing async keywords and replaced return Task.CompletedTask with await calls in Grid.razor.cs.

- Mobile version: added auto-close behavior for sidebar and sidebar2.
NavMenu now closes correctly after selecting a menu item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant