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

Commit 194e7e1

Browse files
committed
fix issue when user re-selects same attr when setting up filter block: - exit early if there's no selected attr passed in
1 parent 5fe2aa9 commit 194e7e1

File tree

1 file changed

+4
-0
lines changed
  • assets/js/blocks/attribute-filter

1 file changed

+4
-0
lines changed

assets/js/blocks/attribute-filter/edit.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
218218

219219
const onChange = useCallback(
220220
( selected ) => {
221+
if ( ! selected || ! selected.length ) {
222+
return;
223+
}
224+
221225
const selectedId = selected[ 0 ].id;
222226
const productAttribute = find( ATTRIBUTES, [
223227
'attribute_id',

0 commit comments

Comments
 (0)