From 87f5d005983982c848a6c58845289699fdf8c658 Mon Sep 17 00:00:00 2001 From: Michal Czaplinski Date: Thu, 17 Oct 2024 17:31:23 +0100 Subject: [PATCH] get value from event.target --- packages/block-library/src/search/view.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/search/view.js b/packages/block-library/src/search/view.js index cdad703789c8d..84f3a35b594ce 100644 --- a/packages/block-library/src/search/view.js +++ b/packages/block-library/src/search/view.js @@ -3,7 +3,6 @@ */ import { store, getContext, getElement } from '@wordpress/interactivity'; - const { state, actions } = store( 'core/search', { @@ -78,9 +77,8 @@ const { state, actions } = store( actions.closeSearchInput(); } }, - *updateSearch() { - const { ref } = getElement(); - const { value } = ref; + *updateSearch( e ) { + const { value } = e.target; // Don't navigate if the search didn't really change. if ( value === state.search ) {