Skip to content

Calculated TableView columns widths are sometimes inaccurate due to state setTableWidth  #3523

@LFDanLu

Description

@LFDanLu

🐛 Bug Report

We've seen a case where an initially hidden column renders with a width of 0 instead of its provided minWidth. It seems to due to setTableWith here becoming stale, which causes column widths to be calculated against an outdated columns prop.

🤔 Expected Behavior

Newly added column is rendered with the proper width

😯 Current Behavior

Newly added column is rendered with 0px width

💁 Possible Solution

Add setTableWidth to dep array here

🔦 Context

💻 Code Sample

Sandbox example: https://codesandbox.io/s/brave-pare-ntibeu?file=/src/App.js. This example doesn't actually exhibit the broken behavior but models the setup the user was seeing.

🌍 Your Environment

Software Version(s)
react-spectrum 3.21.2
Browser
Operating System

🧢 Your Company/Team

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions