It can't do any measuring while it's display:none, so any call to auto size a column should see if it is visible, and if not, queue up a once : truepaint listener to perform the operation the next time it becomes possible.
Try this as an override of the ColumnAutoWidth feature class:
syncAutoWidthColumns() {
const
me = this,
grid = me.client,
storeGeneration = me.storeGeneration;
// Only measure immediately if we are visible.
if (grid.isVisible) {
if (me.lastSync !== storeGeneration) {
me.lastSync = storeGeneration;
let autoWidth, resizingColumns;
for (const column of grid.columns.visibleColumns) {
autoWidth = column.autoWidth;
if (autoWidth) {
if (autoWidth === true) {
autoWidth = me.default;
}
grid.resizingColumns = resizingColumns = true;
column.resizeToFitContent(autoWidth);
}
}
if (resizingColumns) {
grid.resizingColumns = false;
grid.afterColumnsResized();
}
}
if (me.hasTimeout('syncAutoWidthColumns')) {
me.clearTimeout('syncAutoWidthColumns');
}
}
// Otherwise wait till next time we get painted (shown, or a hidden ancestor shown)
else if (me.findListener('paint', 'syncAutoWidthColumns', me) === -1) {
me.on({
paint : 'syncAutoWidthColumns',
thisObj : me,
once : true
});
}
}