@wordpress/components 19.8.1 → 19.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "19.8.1",
3
+ "version": "19.8.2",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -46,7 +46,7 @@
46
46
  "@wordpress/escape-html": "^2.6.1",
47
47
  "@wordpress/hooks": "^3.6.1",
48
48
  "@wordpress/i18n": "^4.6.1",
49
- "@wordpress/icons": "^8.2.1",
49
+ "@wordpress/icons": "^8.2.2",
50
50
  "@wordpress/is-shallow-equal": "^4.6.1",
51
51
  "@wordpress/keycodes": "^3.6.1",
52
52
  "@wordpress/primitives": "^3.4.1",
@@ -76,5 +76,5 @@
76
76
  "publishConfig": {
77
77
  "access": "public"
78
78
  },
79
- "gitHead": "446565ecaa40370173c18926535e975ec5652b71"
79
+ "gitHead": "37e930b93fbba88fa024a91eb527a90f855c97f3"
80
80
  }
@@ -9,7 +9,10 @@ import { kebabCase } from 'lodash';
9
9
  import { useState, useRef, useEffect } from '@wordpress/element';
10
10
  import { __, sprintf } from '@wordpress/i18n';
11
11
  import { lineSolid, moreVertical, plus } from '@wordpress/icons';
12
- import { __experimentalUseFocusOutside as useFocusOutside } from '@wordpress/compose';
12
+ import {
13
+ __experimentalUseFocusOutside as useFocusOutside,
14
+ useDebounce,
15
+ } from '@wordpress/compose';
13
16
 
14
17
  /**
15
18
  * Internal dependencies
@@ -197,6 +200,9 @@ function PaletteEditListView( {
197
200
  }
198
201
  };
199
202
  }, [] );
203
+
204
+ const debounceOnChange = useDebounce( onChange, 100 );
205
+
200
206
  return (
201
207
  <VStack spacing={ 3 }>
202
208
  <ItemGroup isRounded>
@@ -212,7 +218,7 @@ function PaletteEditListView( {
212
218
  }
213
219
  } }
214
220
  onChange={ ( newElement ) => {
215
- onChange(
221
+ debounceOnChange(
216
222
  elements.map(
217
223
  ( currentElement, currentIndex ) => {
218
224
  if ( currentIndex === index ) {