Skip to content

Conversation

@r0b1n
Copy link
Collaborator

@r0b1n r0b1n commented Oct 22, 2025

Pull request type

Bug fix / New feature


Description

With recent improvements of virtual scrolling we introduced an issue with horizontal scroll where vertical scrollbar goes out of sight. To mitigate this we took a new approach and improved vertical scrolling even more. This gives the users ability scroll in both directions and have more natural look and feel when virtual scrolling is enabled.

As a small feature we introduced shadows when the grid is scrolled, so the users immediately see that the grid is in the middle of the scroll, this is a good QoL improvement.

What should be covered while testing?

  • Check that with fixed scrollbars (usually Windows) and with hide-able scrollbars (usually Mac) alignment of the header and columns work as expected.
  • Check that non-virtual scrolling still works as before.

@r0b1n r0b1n requested a review from a team as a code owner October 22, 2025 10:13
@r0b1n r0b1n force-pushed the dg2-virtual-scroll-new branch 3 times, most recently from 735ffa8 to 02cf2af Compare December 2, 2025 16:36
@github-actions github-actions bot removed the shared label Dec 2, 2025
Comment on lines 48 to 52
const lockGridBodyHeight = useCallback((): void => {
if (isVisible && isInfinite && hasMoreItems && gridBodyHeight === undefined && gridBody) {
gridSizeStore.setGridBodyHeight(gridBody.clientHeight - offsetBottom);
}
}, [isVisible, isInfinite, hasMoreItems, gridBodyHeight, gridBody, gridSizeStore]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this should be an action on GridSizestore. All this deps coming from this store except isVisible. So, I think we can make action and just pass isVisible as argument.

@r0b1n r0b1n force-pushed the dg2-virtual-scroll-new branch from 02cf2af to f5e5ff4 Compare December 4, 2025 14:46
import { useInfiniteControl } from "@mendix/widget-plugin-grid/components/InfiniteBody";
import { RefObject, UIEventHandler, useCallback } from "react";
import { usePaginationService } from "./injection-hooks";
import { UIEventHandler } from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: this might be removed but, OK :D

Comment on lines 82 to 92
/**
* const lockGridBodyHeight = useCallback((): void => {
* if (isVisible && hasVirtualScrolling && hasMoreItems && gridBodyHeight === undefined && gridBody) {
* gridSizeStore.setGridBodyHeight(gridBody.clientHeight - offsetBottom);
* }
* }, [isVisible, hasVirtualScrolling, hasMoreItems, gridBodyHeight, gridBody, gridSizeStore]);
*
* useLayoutEffect(() => {
* setTimeout(() => lockGridBodyHeight(), 100);
* }, [lockGridBodyHeight]);
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments

@r0b1n r0b1n force-pushed the dg2-virtual-scroll-new branch from f5e5ff4 to 2f7959d Compare December 4, 2025 15:11
Copy link
Collaborator

@iobuhov iobuhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants