Bug: duplicate key when using QueryControls with categorySuggestions #49515
Labels
[Block] Latest Posts
Affects the Latest Posts Block
[Package] Components
/packages/components
[Type] Bug
An existing feature does not function as intended
There are 2 separate but related issues here.
QueryControls component
The category name is used when defining the key, because those are not unique when you have multiple categories with the same name you'll get duplicate keys and UI side effects where you cannot remove the duplicate tokens in the Editor.
For reference:
gutenberg/packages/components/src/query-controls/index.tsx
Line 157 in f70ecc5
gutenberg/packages/components/src/form-token-field/index.tsx
Line 599 in f70ecc5
Latest Posts block
This also affects the Latest Posts component in a couple ways. The first is not directly related to the above problem, but it is unable to display categories with the same names as suggestions because it too uses the non-unique name as seen here:
gutenberg/packages/block-library/src/latest-posts/edit.js
Line 172 in f70ecc5
To reproduce:
The text was updated successfully, but these errors were encountered: