Skip to content

Commit

Permalink
Components: refactor ComboboxControl to pass exhaustive-deps (#41417
Browse files Browse the repository at this point in the history
)

* remove `value` from `matchingSuggestions` `useMemo` dependency array

* ComboboxControl: update changelog
  • Loading branch information
chad1008 authored Aug 31, 2022
1 parent 5844e0b commit b4417e9
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
- `Guide`: use `code` instead of `keyCode` for keyboard events ([#43604](https://github.com/WordPress/gutenberg/pull/43604/)).
- `Navigation`: use `code` instead of `keyCode` for keyboard events ([#43644](https://github.com/WordPress/gutenberg/pull/43644/)).
- `ComboboxControl`: Add unit tests ([#42403](https://github.com/WordPress/gutenberg/pull/42403)).
- `ComboboxControl`: updated to satisfy `react/exhuastive-deps` eslint rule ([#41417](https://github.com/WordPress/gutenberg/pull/41417))

## 20.0.0 (2022-08-24)

2 changes: 1 addition & 1 deletion packages/components/src/combobox-control/index.js
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ function ComboboxControl( {
} );

return startsWithMatch.concat( containsMatch );
}, [ inputValue, options, value ] );
}, [ inputValue, options ] );

const onSuggestionSelected = ( newSelectedSuggestion ) => {
setValue( newSelectedSuggestion.value );

0 comments on commit b4417e9

Please sign in to comment.