Skip to content
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: Suggestion is expanded on load when __experimentalExpandOnFocus is set to true #42528

Closed
dinhtungdu opened this issue Jul 19, 2022 · 4 comments
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@dinhtungdu
Copy link
Contributor

Description

If __experimentalExpandOnFocus is set for <FormTokenField> component, the suggestion list is expanded after page load without any user interaction.

Step-by-step reproduction instructions

  1. Add the following story to packages/components/src/form-token-field/stories/index.tsx:
export const ExpandOnFocus: ComponentStory< typeof FormTokenField > =
	DefaultTemplate.bind( {} );
ExpandOnFocus.args = {
	...Default.args,
	__experimentalExpandOnFocus: true,
};
  1. See suggestion list is expanded without focusing on the token input field.

Note: The DropdownSelector story in #42527 can be used for testing this issue.

Screenshots, screen recording, code snippet

Screen.Recording.2022-07-19.at.17.35.12.mov

Environment info

No response

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

@kathrynwp kathrynwp added [Type] Bug An existing feature does not function as intended Needs Technical Feedback Needs testing from a developer perspective. [Package] Components /packages/components labels Jul 19, 2022
@mirka
Copy link
Member

mirka commented Jul 19, 2022

Confirmed, the bug is here.

@mirka mirka removed the Needs Technical Feedback Needs testing from a developer perspective. label Jul 19, 2022
@mirka mirka changed the title Suggestion is expanded on load when __experimentalExpandOnFocus is set to true FormTokenField: Suggestion is expanded on load when __experimentalExpandOnFocus is set to true Jul 19, 2022
@dinhtungdu
Copy link
Contributor Author

Confirmed, the bug is here.

@mirka Tracing the history, I found that this issue is a regression introduced in #41216.

@hbhalodia
Copy link
Contributor

Hi @mirka, checked current story book, the issue is not reproducible yet. See here.

expandOnFocus.webm

@mirka
Copy link
Member

mirka commented Feb 17, 2023

Great, thank you for looking into it!

@mirka mirka closed this as completed Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants