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] Close the form when the number of tokens reach maxLength #42773

Open
dinhtungdu opened this issue Jul 28, 2022 · 0 comments
Open
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@dinhtungdu
Copy link
Contributor

What problem does this address?

When <FormTokenField/> is used as a dropdown selector, it's natural to collapse the suggestions and hide the input field when a token is selected (like the <select> behavior).

By the way, closing the form is also a good way to inform users that the maximum number of tokens is selected.

What is your proposed solution?

We have two options:

  • Create another prop to control this behavior, something like __experimentalCollapseOnMaxLenghtReach.
  • Or, set this as the default behavior, when maxLength is set. (This may be not realistic because it changes the behavior of the component which many sites are depending on that).

Additional information:

This is suggested by @Aljullu on woocommerce/woocommerce-blocks#6647 (review)

@Aljullu Aljullu added the [Package] Components /packages/components label Jul 28, 2022
@dinhtungdu dinhtungdu changed the title [FormTokenField] Close the form when number of token reach maxLength [FormTokenField] Close the form when the number of tokens reach maxLength Jul 29, 2022
@mirka mirka added the [Type] Enhancement A suggestion for improvement. label Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants