From 023f175d3befb9548017008da931c61190f36aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Thu, 26 May 2022 12:31:29 +0200 Subject: [PATCH] Remove Combobox patch (#6465) --- assets/js/base/components/combobox/index.tsx | 2 - package-lock.json | 48 -------------------- package.json | 1 - patches/wordpress-components+14.2.0.patch | 44 ------------------ 4 files changed, 95 deletions(-) delete mode 100644 patches/wordpress-components+14.2.0.patch diff --git a/assets/js/base/components/combobox/index.tsx b/assets/js/base/components/combobox/index.tsx index f0a492fa948..8ed9af5baf6 100644 --- a/assets/js/base/components/combobox/index.tsx +++ b/assets/js/base/components/combobox/index.tsx @@ -92,8 +92,6 @@ const Combobox = ( { setValidationErrors, ] ); - // @todo Remove patch for ComboboxControl once https://github.com/WordPress/gutenberg/pull/33928 is released - // Also see https://github.com/WordPress/gutenberg/pull/34090 return (
option.value === value); -@@ -135,7 +136,12 @@ function ComboboxControl({ - } - }; - -+ const onBlur = () => { -+ setInputHasFocus( false ); -+ }; -+ - const onFocus = () => { -+ setInputHasFocus( true ); - setIsExpanded(true); - onFilterValueChange(''); - setInputValue(''); -@@ -149,7 +155,9 @@ function ComboboxControl({ - const text = event.value; - setInputValue(text); - onFilterValueChange(text); -- setIsExpanded(true); -+ if ( inputHasFocus ) { -+ setIsExpanded( true ); -+ } - }; - - const handleOnReset = () => { -@@ -193,6 +201,7 @@ function ComboboxControl({ - value: isExpanded ? inputValue : currentLabel, - "aria-label": currentLabel ? `${currentLabel}, ${label}` : null, - onFocus: onFocus, -+ onBlur: onBlur, - isExpanded: isExpanded, - selectedSuggestionIndex: matchingSuggestions.indexOf(selectedSuggestion), - onChange: onInputChange