From 660b8282e05d15c464409d4a7333134bc3430667 Mon Sep 17 00:00:00 2001 From: Mayank <9084735+mayank99@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:41:41 -0400 Subject: [PATCH] move `contain` to virtual-scroll parent (#2166) --- packages/itwinui-react/src/utils/hooks/useVirtualScroll.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/itwinui-react/src/utils/hooks/useVirtualScroll.ts b/packages/itwinui-react/src/utils/hooks/useVirtualScroll.ts index 861e979073c..fcf19e80f89 100644 --- a/packages/itwinui-react/src/utils/hooks/useVirtualScroll.ts +++ b/packages/itwinui-react/src/utils/hooks/useVirtualScroll.ts @@ -8,9 +8,12 @@ import type { ScrollToOptions, Virtualizer } from '@tanstack/react-virtual'; import React from 'react'; const css = /*css*/ ` +:host { + contain: layout; + background-color: var(--iui-color-background); +} [data-iui-virtualizer='root'] { min-inline-size: 100%; - contain: layout; position: relative; } ::slotted([data-iui-virtualizer='item']) {