Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Toolbar): applied chip container class only if it's not hidden #9398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ export class ToolbarChipGroupContent extends React.Component<ToolbarChipGroupCon
(canUseDOM ? window.innerWidth : 1200) < globalBreakpoints[collapseListedFiltersBreakpoint];
}

const isHidden = numberOfFilters === 0 || isExpanded;

return (
<div
className={css(
styles.toolbarContent,
!collapseListedFilters && styles.modifiers.chipContainer,
(numberOfFilters === 0 || isExpanded) && styles.modifiers.hidden,
!isHidden && !collapseListedFilters && styles.modifiers.chipContainer,
isHidden && styles.modifiers.hidden,
className
)}
{...((numberOfFilters === 0 || isExpanded) && { hidden: true })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`ToolbarChipGroupContent should match snapshot (auto-generated) 1`] = `
<DocumentFragment>
<div
class="pf-v5-c-toolbar__content pf-m-chip-container pf-m-hidden string"
class="pf-v5-c-toolbar__content pf-m-hidden string"
hidden=""
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`Toolbar should render inset 1`] = `
</div>
</div>
<div
class="pf-v5-c-toolbar__content pf-m-chip-container pf-m-hidden"
class="pf-v5-c-toolbar__content pf-m-hidden"
hidden=""
>
<div
Expand Down Expand Up @@ -395,7 +395,7 @@ exports[`Toolbar should render with page inset flag 1`] = `
</div>
</div>
<div
class="pf-v5-c-toolbar__content pf-m-chip-container pf-m-hidden"
class="pf-v5-c-toolbar__content pf-m-hidden"
hidden=""
>
<div
Expand Down
Loading