Skip to content

Commit 98c08cd

Browse files
committed
fix(datagrid-web): preventScroll on column selector focus
1 parent 057ed0b commit 98c08cd

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/pluggableWidgets/datagrid-web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- We fixed an issue where the datagrid's horizontal scrollbar would unexpectedly jump to the right when the column selector was enabled.
12+
913
## [3.0.1] - 2025-08-05
1014

1115
### Fixed

packages/pluggableWidgets/datagrid-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mendix/datagrid-web",
33
"widgetName": "Datagrid",
4-
"version": "3.0.1",
4+
"version": "3.0.2",
55
"description": "",
66
"copyright": "© Mendix Technology BV 2025. All rights reserved.",
77
"license": "Apache-2.0",

packages/pluggableWidgets/datagrid-web/src/components/ColumnSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export function ColumnSelector(props: ColumnSelectorProps): ReactElement {
5656
(refs.floating?.current?.querySelector("li") as HTMLElement)?.focus();
5757
}, 10);
5858
} else {
59-
// focus back to the button when closing
59+
// focus back to the button when closing (prevent scroll to prevent horizontal scroll jumps on initial render)
6060
setTimeout(() => {
61-
(refs.reference?.current as HTMLElement)?.focus();
61+
(refs.reference?.current as HTMLElement)?.focus({ preventScroll: true });
6262
}, 10);
6363
}
6464
}, [show]);

packages/pluggableWidgets/datagrid-web/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="Datagrid" version="3.0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Datagrid" version="3.0.2" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Datagrid.xml" />
66
</widgetFiles>

0 commit comments

Comments
 (0)