Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix: Filter button is not aligned with the input field #4814

Merged
merged 3 commits into from
Sep 30, 2021
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
4 changes: 3 additions & 1 deletion assets/js/blocks/attribute-filter/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ const AttributeFilterBlock = ( {
{ blockAttributes.heading }
</TagName>
) }
<div className="wc-block-attribute-filter">
<div
className={ `wc-block-attribute-filter style-${ blockAttributes.displayStyle }` }
>
{ blockAttributes.displayStyle === 'dropdown' ? (
<DropdownSelector
attributeLabel={ attributeObject.label }
Expand Down
16 changes: 14 additions & 2 deletions assets/js/blocks/attribute-filter/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
.wc-block-attribute-filter {
margin-bottom: $gap-large;

&.style-dropdown {
display: flex;
gap: $gap;
}

.wc-block-attribute-filter-list {
margin: 0;
width: 100%;

li {
text-decoration: underline;
Expand All @@ -18,12 +24,18 @@
}
}

.wc-block-attribute-filter-dropdown {
flex-grow: 1;
max-width: unset;
width: 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, much better and simpler fix than the one I suggested. Good catch! 👌

}

.is-single .wc-block-attribute-filter-list-count,
.wc-block-dropdown-selector .wc-block-dropdown-selector__list .wc-block-attribute-filter-list-count {
opacity: 0.6;
}

.wc-block-attribute-filter__button {
margin-top: $gap-smaller;
.wc-block-components-dropdown-selector__input-wrapper {
height: 100%;
}
}