Skip to content

TableView doesn't resize properly when wrapped in React.StrictMode #2249

Closed
@LFDanLu

Description

@LFDanLu

🐛 Bug Report

When wrapped in React.StrictMode, TableView's ScrollView doesn't adjust its height properly when items are removed. The height remains the same as before the items were removed, allowing the user to scroll the TableView's contents even if the content now fits in the provided height without overflow.

🤔 Expected Behavior

TableView's scrollview height should adjust itself automatically when items are removed/added

😯 Current Behavior

TableView's scrollview height doesn't adjust itself automatically when items are removed/added

💁 Possible Solution

Not sure, would need to figure out why React.StrictMode is causing this behavior. Feels similar to the other collection component bugs (ListBox, etc) strict mode issues.

🔦 Context

💻 Code Sample

https://codesandbox.io/s/zealous-villani-g4rbw?file=/src/App.js

🌍 Your Environment

Software Version(s)
react-spectrum 3.13
Browser . all
Operating System . MacOS

🧢 Your Company/Team

🕷 Tracking Issue (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions