Skip to content

Commit

Permalink
use only layout containment in virtualizers (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 authored Jul 23, 2024
1 parent 2952902 commit d5bc69c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-sloths-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Fixed an issue in virtualized `Table` where horizontal scroll was broken.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/react-workshop/src/Table.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ describe('Table', () => {
});

cy.compareSnapshot(testName);

if (testName === 'Full2') {
cy.get('[role=table]').scrollTo('right');
cy.compareSnapshot(`${testName} (scrolled right)`);
}
});
});
});
3 changes: 2 additions & 1 deletion packages/itwinui-react/src/core/ComboBox/ComboBoxMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ const VirtualizedComboBoxMenu = (props: React.ComponentProps<'div'>) => {
style={{
minBlockSize: virtualizer.getTotalSize(),
minInlineSize: '100%',
contain: 'strict',
contain: 'layout',
position: 'relative',
...props.style,
}}
>
Expand Down
3 changes: 2 additions & 1 deletion packages/itwinui-react/src/core/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,8 @@ export const Table = <
style={{
minBlockSize: virtualizer.getTotalSize(),
minInlineSize: '100%',
contain: 'strict',
contain: 'layout',
position: 'relative',
}}
>
<slot />
Expand Down
3 changes: 2 additions & 1 deletion packages/itwinui-react/src/core/Tree/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ const VirtualizedTree = React.forwardRef(
<div
style={{
minBlockSize: virtualizer.getTotalSize(),
contain: 'strict',
contain: 'layout',
position: 'relative',
}}
>
<slot />
Expand Down

0 comments on commit d5bc69c

Please sign in to comment.