Skip to content

Commit 518d4c4

Browse files
authored
fix(FilterBar): only display toolbar separator & overflow button when necessary (#1570)
1 parent 14eccdc commit 518d4c4

File tree

1 file changed

+3
-3
lines changed
  • packages/main/src/components/FilterBar

1 file changed

+3
-3
lines changed

packages/main/src/components/FilterBar/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ const FilterBar: FC<FilterBarPropTypes> = forwardRef((props: FilterBarPropTypes,
486486
)}
487487
</>
488488
);
489-
489+
const hasButtons = ToolbarButtons.props.children.some(Boolean);
490490
return (
491491
<>
492492
{dialogOpen && showFilterConfiguration && (
@@ -520,9 +520,9 @@ const FilterBar: FC<FilterBarPropTypes> = forwardRef((props: FilterBarPropTypes,
520520
{useToolbar && (
521521
<Toolbar className={classes.filterBarHeader} toolbarStyle={ToolbarStyle.Clear}>
522522
{variants}
523-
{search && <ToolbarSeparator />}
523+
{variants && search && <ToolbarSeparator />}
524524
{search && <div ref={searchRef}>{renderSearchWithValue(search, searchValue)}</div>}
525-
<ToolbarSpacer />
525+
{hasButtons && <ToolbarSpacer />}
526526
{ToolbarButtons}
527527
</Toolbar>
528528
)}

0 commit comments

Comments
 (0)