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

Fix SearchListControl styles #10192

Merged
merged 4 commits into from
Jul 14, 2023
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
44 changes: 26 additions & 18 deletions assets/js/editor-components/search-list-control/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export const SearchListItem = ( {
)
? { indeterminate: true }
: {} ) }
label={ getHighlightedName( item.name, search ) }
label={ getHighlightedName(
decodeEntities( item.name ),
search
) }
onChange={ () => {
if ( isSelected ) {
onSelect(
Expand Down Expand Up @@ -160,31 +163,36 @@ export const SearchListItem = ( {
) : (
<label htmlFor={ id } className={ classes }>
{ isSingle ? (
<input
type="radio"
id={ id }
name={ name }
value={ item.value }
onChange={ onSelect( item ) }
checked={ isSelected }
className="woocommerce-search-list__item-input"
{ ...props }
></input>
<>
<input
type="radio"
id={ id }
name={ name }
value={ item.value }
onChange={ onSelect( item ) }
checked={ isSelected }
className="woocommerce-search-list__item-input"
{ ...props }
></input>

<ItemLabel item={ item } search={ search } />
</>
) : (
<input
type="checkbox"
<CheckboxControl
id={ id }
name={ name }
value={ item.value }
className="woocommerce-search-list__item-input"
value={ decodeEntities( item.value ) }
label={ getHighlightedName(
decodeEntities( item.name ),
search
) }
onChange={ onSelect( item ) }
checked={ isSelected }
className="woocommerce-search-list__item-input"
{ ...props }
></input>
/>
) }

<ItemLabel item={ item } search={ search } />

{ showCount ? <Count label={ countLabel || item.count } /> : null }
</label>
);
Expand Down
2 changes: 1 addition & 1 deletion assets/js/editor-components/search-list-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
}
}

.woocommerce-search-list__item-input {
.woocommerce-search-list__item-input[type="radio"] {
margin: 0 $gap-smaller 0 0;
}

Expand Down
Loading
Loading