Fix autosizing to handle column with checkbox
[From @TomTirapani ]
Our preferred solution would be to leverage the autosize system with a min / max for this column - but unfortunately autosize is not accounting for the checkbox properly and will always truncate when autosized.
Having thought about this a bit more, I remembered we have this autosizeBufferPx property on Column: https://github.com/xh/hoist-react/blob/develop/cmp/grid/columns/Column.ts#L313
This adds an additional width to whatever width the autosize is calculated to. We might be able to use this to workaround the autosize issue (which is a separate issue we should address, but not one with an immediate solution).
Here's what I recommend we do:
Add a suitable autosizeBufferPx to the column when includeCheckboxes is true. It may take some experimentation to get the right value, probably something like 40. Add a suitable autosizeMinWidth and autosizeMaxWidth to the root nameCol to prevent is becoming unweildly. Set the GridModel's autosizeOptions.mode to 'managed', so that it automatically autosizes the column. https://github.com/xh/hoist-react/blob/develop/cmp/grid/enums/GridAutosizeMode.ts#L32 I think with the above we can remove the default width from nameCol and leverage the autosizing system to display the column properly without truncating.
NOTE: We may have a workaround in toolbox for this problem -- be sure to remove when this gets merged
I messaged Lee, but posting this here as well. I implemented Tom's suggestions and have the managed role taking effect. BUT, it's not fully a solution - the reason I didn't think the role was working is that the grid doesn't autosize when the grid loads, it autosizes when the specific box that is cut off gets selected by the user. So, it is a partial solution in that the grid autosizes at some point but I think the full solution where the grid is autosizes right away might involve tweaking the autosizeAsync method in GridModel.
I'm not sure why this happens, since the GridAutosizeMode MANAGED says that it causes an autosize on data load. I will look more into the GridModel function for potential solutions.