-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormTokenField
: Issues with multiple identical strings
#62533
Comments
Thanks for the report! It is true that somebody needs to be responsible for ensuring uniqueness, but ultimately I don't think it can/should be The repro instructions you posted are in fact problematic at the application level and can be considered a bug though. Would it be fair to reclassify that as an app bug, rather than a problem with |
Thanks for the discussion and insights on this issue. I would like to clarify a few points regarding the responsibility of not relying on uniqueness in
Side Note: After re-reading the implementation of Given these points, it is evident that addressing the issue within |
Description
The
FormTokenField
component encounters issues when handling multiple tokens with identical string values. Specifically, when two or more items have the same name or title, the component fails to manage them correctly. This reliance on string matching without unique identifiers causes a React error and prevents selection of the duplicate items.Expected Behavior:
Current Behavior:
P.S.: I am aware that the
FormTokenField
is currently being rewritten. However, I believe it is important to report this issue regardless.Step-by-step reproduction instructions
Create a post tag called 'Identical Name'.
Create a second post tag called 'Identical Name2'.
Edit the second post tag to be 'Identical Name'.
Create a new post.
Edit post tags.
Type 'Identical Name' in the
FormTokenField
.FormTokenField
as it attempts to handle the duplicate tags.Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: