-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix form token field suggestion list reopening after blurring the input #57002
Conversation
Flaky tests detected in 344d1c9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7225832900
|
It'd be good to add some tests for this, though I'm a little bit lacking into time and not really up-to-speed on the testing for UI components these days. |
2c4173f
to
bd82453
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests well and I agree it's easier to read this way 👍
I also agree tests would be good to add, but we can address them in a follow up so this fix gets in now. 🚀 🚢
…ut (#57002) * Update boolean logic to ensure suggestions list closes when expandOnFocus prop is false * Improve readability * Add Changelog entry * Fix CHANGELOG, move entry to the "Unreleased" section --------- Co-authored-by: Marcelo Serpa <[email protected]>
…ut (#57002) * Update boolean logic to ensure suggestions list closes when expandOnFocus prop is false * Improve readability * Add Changelog entry * Fix CHANGELOG, move entry to the "Unreleased" section --------- Co-authored-by: Marcelo Serpa <[email protected]>
…ut (#57002) * Update boolean logic to ensure suggestions list closes when expandOnFocus prop is false * Improve readability * Add Changelog entry * Fix CHANGELOG, move entry to the "Unreleased" section --------- Co-authored-by: Marcelo Serpa <[email protected]>
What?
Fixes a regression caused by #56426. Fixes #57085.
That PR accidentally changed the behavior of
FormTokenField
when__experimentalExpandOnFocus
isn't defined, and it should have retained the existing behavior.It results in the suggestion list unexpectedly reopening after selecting a suggestion and then blurring the input.
How?
I've adjusted the boolean logic that was previously in place to instead use an if statement that should make the code much more readable.
Testing Instructions
Prerequisite: Ensure you already have some post tags defined
In Trunk: The suggestion list closes and then reopens
In this PR: The suggestion list remains closed
Screenshots or screencast
Before
Kapture.2023-12-13.at.12.12.34.mp4
After
Kapture.2023-12-13.at.12.14.38.mp4