Fix: encode and decode term slug to support non-ASCII terms (https://github.com/woocommerce/woocommerce-blocks/pull/7906)
This commit is contained in:
parent
8bbb14f23b
commit
e306334911
|
@ -282,6 +282,13 @@ const AttributeFilterBlock = ( {
|
|||
*/
|
||||
const updateFilterUrl = useCallback(
|
||||
( query, allFiltersRemoved = false ) => {
|
||||
query = query.map( ( item: AttributeQuery ) => ( {
|
||||
...item,
|
||||
slug: item.slug.map( ( slug: string ) =>
|
||||
decodeURIComponent( slug )
|
||||
),
|
||||
} ) );
|
||||
|
||||
if ( allFiltersRemoved ) {
|
||||
if ( ! attributeObject?.taxonomy ) {
|
||||
return;
|
||||
|
|
|
@ -71,7 +71,9 @@ export const getActiveFilters = (
|
|||
? defaultAttributeParam.split( ',' )
|
||||
: [];
|
||||
|
||||
return defaultCheckedValue;
|
||||
return defaultCheckedValue.map( ( value ) =>
|
||||
encodeURIComponent( value ).toLowerCase()
|
||||
);
|
||||
}
|
||||
|
||||
return [];
|
||||
|
|
Loading…
Reference in New Issue