[Experimental] Fix Active Filter chips style (#44682)

This commit is contained in:
Tung Du 2024-02-16 17:09:49 +07:00 committed by GitHub
parent 75118fbe40
commit 0425857b7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,5 @@
@import "../../../../../../packages/components/chip/style";
.wp-block-woocommerce-product-filter-active {
margin-bottom: $gap-large;
overflow: hidden;

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
[Experimental] Fix the style of chip for new active filter block.

View File

@ -61,12 +61,18 @@ final class ProductFilterActive extends AbstractBlock {
)
);
$list_classes = 'filter-list';
if ( 'chips' === $attributes['displayStyle'] ) {
$list_classes .= ' list-chips';
}
ob_start();
?>
<div <?php echo $wrapper_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php if ( ! empty( $active_filters ) ) : ?>
<ul class="filter-list">
<ul class="<?php echo esc_attr( $list_classes ); ?>">
<?php foreach ( $active_filters as $filter ) : ?>
<li>
<span class="list-item-type"><?php echo esc_html( $filter['type'] ); ?>: </span>