Skip to content

Commit

Permalink
fix: Preserve group toggle space when hidden #974
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Oct 28, 2021
1 parent 57097e2 commit f540bb3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ui/src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ const
top: -2,
right: -5
},
// HACK: incorrect width recalculated after changing to "group by mode" - collapse icon in header
// causes horizontal overflow for whole table.
hideCellGroupCollapse: {
$nest: {
'div[class*="cellIsGroupExpander"]': {
visibility: 'hidden'
}
}
}
}),
styles: Partial<Fluent.IDetailsListStyles> = {
headerWrapper: {
Expand Down Expand Up @@ -313,10 +322,10 @@ const

return (
<Fluent.Sticky stickyPosition={Fluent.StickyPositionType.Header} isScrollSynced>
<Fluent.DetailsHeader {...props} onColumnContextMenu={onColumnContextMenu} />
<Fluent.DetailsHeader {...props} onColumnContextMenu={onColumnContextMenu} className={groups ? css.hideCellGroupCollapse : ''} />
</Fluent.Sticky>
)
}, [onColumnContextMenu]),
}, [groups, onColumnContextMenu]),
onRenderDetailsFooter = (props?: Fluent.IDetailsFooterProps) => {
const isFilterable = m.columns.some(c => c.filterable)
if (!props || (!m.downloadable && !m.resettable && !isSearchable && !isFilterable)) return null
Expand Down

0 comments on commit f540bb3

Please sign in to comment.