fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

DetailsList: Allow resizing columns in justified layout

Open pablonete opened this issue 10 years ago • 5 comments

DetailsList switches to fixedColumns layout when any column is resized, regardless of the layoutMode prop. Culprit is this line: https://github.com/OfficeDev/office-ui-fabric-react/blob/master/src/components/DetailsList/DetailsList.tsx#L591

This may be seen like a bug. Instead, I would expect the new size to be respected and the rest of columns to adapt themselves in order to keep the justified original intention.

pablonete avatar Nov 08 '16 10:11 pablonete

Given the current "justified layout" algo, there are a bunch of really unexpected user experiences created by this. For example because of min/max values, resizing something towards the right to give more room on the left could result in columns on the right getting smaller. Or resizing something smaller suddenly gives more room for an extra column (we "drop off" columns that can't fit) so we suddenly adjust all the columns' widths, which is really janky. It's hard to describe all the cases we hit, but we originally had this feature and decided to opt for the "fallback to fixed mode" in this case.

It's possible to adjust the layout algo to support this but it would be such a significant change that I'd probably introduce another layout mode...

dzearing avatar Nov 11 '16 17:11 dzearing

Can we see a demo of the columns not being resizable in justified layout? On the site, I'm seeing what I understand as being the right behavior. I think I'm just missing it 😄

ericthompson avatar Nov 11 '16 20:11 ericthompson

@ericthompson I can show you in person what he means.

dzearing avatar Nov 11 '16 22:11 dzearing

Is there any update on this bug? We have been experiencing a similar issue. We are using justified layout and using minWidth, maxWidth properties on columns. When rendered initially, the columns are adjusted to the available viewport width. When we resize columns, the columns dont change their widths according to available space and we start seeing a horizontal scrollbar even though there is enough space to adjust column widths. I looked at the code and the code always uses fixedLayout mode when columns are resized. However this scenario works perfectly if we resize the whole browser window - because in this scenario it uses the layout mode passed on by the caller

mohitbagra avatar Mar 07 '17 17:03 mohitbagra

@dzearing We're still waiting for this fix. Is there any work going or planned to cover this requirement? Otherwise, I can put some time and contribute a proposal.

pablonete avatar Aug 07 '17 13:08 pablonete