Fix form token field suggestion list reopening after blurring the input - #57002
Merged
Merged
Conversation
|
Flaky tests detected in 344d1c9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7225832900
|
Contributor
Author
|
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. |
fullofcaffeine
force-pushed
the
fix/form-token-field-submit-issue
branch
from
December 15, 2023 18:37
2c4173f to
bd82453
Compare
chad1008
approved these changes
Dec 15, 2023
chad1008
left a comment
Contributor
There was a problem hiding this comment.
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. 🚀 🚢
fullofcaffeine
added a commit
that referenced
this pull request
Dec 15, 2023
…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 <boss@fullofcaffeine.com>
fullofcaffeine
added a commit
that referenced
this pull request
Dec 15, 2023
…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 <boss@fullofcaffeine.com>
artemiomorales
pushed a commit
that referenced
this pull request
Jan 4, 2024
…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 <boss@fullofcaffeine.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes a regression caused by #56426. Fixes #57085.
That PR accidentally changed the behavior of
FormTokenFieldwhen__experimentalExpandOnFocusisn'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