Skip to content

Commit 3880bde

Browse files
committed
fix(ScrollView): don't report empty visible rect when the content suspends
closes adobe#8214
1 parent c1fd8af commit 3880bde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-aria/virtualizer/src/ScrollView.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export function useScrollView(props: ScrollViewProps, ref: RefObject<HTMLElement
184184
// adjusted space. In very specific cases this might result in the scrollbars disappearing
185185
// again, resulting in extra padding. We stop after a maximum of two layout passes to avoid
186186
// an infinite loop. This matches how browsers behavior with native CSS grid layout.
187-
if (!isTestEnv && clientWidth !== dom.clientWidth || clientHeight !== dom.clientHeight) {
187+
if (!isTestEnv && (dom.checkVisibility?.() ?? true) && (clientWidth !== dom.clientWidth || clientHeight !== dom.clientHeight)) {
188188
state.width = dom.clientWidth;
189189
state.height = dom.clientHeight;
190190
flush(() => {

0 commit comments

Comments
 (0)