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

TableView column does not respect minWidth

Open MBernardAdobe opened this issue 3 years ago โ€ข 1 comments

๐Ÿ› Bug Report

When a width is set on a Column in a V3 TableView, it seems to be the only thing considered when defining the width of that column, even if there is a minWidth also on that column. See the sandbox below: https://codesandbox.io/s/react-spectrum-template-forked-cxfw8b?file=/src/App.js

๐Ÿค” Expected Behavior

The width of an element should be the greater of its calculated width, or the minWidth.

๐Ÿ˜ฏ Current Behavior

          <Column
            showDivider={true}
            minWidth={500}
            width={50}
          >

We would expect the column's width to be 500, but it is 50.

๐Ÿ’ Possible Solution

๐Ÿ”ฆ Context

I would like to make a table where column A and B are the same size, column C is half that size, and column D is at least 40px wide and otherwise half the size of C.

๐Ÿ’ป Code Sample

https://codesandbox.io/s/react-spectrum-template-forked-cxfw8b?file=/src/App.js

๐ŸŒ Your Environment

Software Version(s)
react-spectrum 3.20.0
Browser Chrome
Operating System OS X 12.4

๐Ÿงข Your Company/Team

Adobe/AEP

๐Ÿ•ท Tracking Issue (optional)

MBernardAdobe avatar Aug 01 '22 22:08 MBernardAdobe

From discussion, our width/min-width should behave like CSS width/min-width

snowystinger avatar Aug 01 '22 23:08 snowystinger