react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Setting "display:none" on ListView parent crashes the page

Open bmingles opened this issue 1 year ago โ€ข 0 comments

Provide a general summary of the issue here

If I set "display:none" on a parent element of a ListView, it crashes the page.

<div style={{ display: "none" }}>
    <ListView items={items}>
        {(item) => <Item key={item.id}>{item.name}</Item>}
    </ListView>
</div>

Possibly related to https://github.com/adobe/react-spectrum/issues/6181

๐Ÿค” Expected Behavior?

ListView should not throw errors if parent is hidden.

๐Ÿ˜ฏ Current Behavior

ListView throws errors when parent is hidden.

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

https://codesandbox.io/p/sandbox/list-view-zero-height-forked-jr8h3h

Version

^3.34.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

MacOS

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

bmingles avatar Apr 30 '24 19:04 bmingles