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

Add chip after Enter key or allow to add chips programmatically #20

Open
oliverbytes opened this issue Apr 5, 2022 · 3 comments
Open

Comments

@oliverbytes
Copy link

oliverbytes commented Apr 5, 2022

Like how most popular apps implement them. Pressing the enter key / submitting automatically adds the entered text as a chip.

@zsoerenm
Copy link
Owner

zsoerenm commented Apr 5, 2022

How should that work?
What if the entered text does not match a suggestion, or what if the entered text matches multiple suggestions?

@oliverbytes
Copy link
Author

How should that work?
What if the entered text does not match a suggestion, or what if the entered text matches multiple suggestions?

Yeah. I think If it doesn't match a suggestion, use it. If matches multiple suggestions, use the first one.

@zsoerenm
Copy link
Owner

zsoerenm commented Apr 5, 2022

Your first suggestion won't work, if the suggestions are objects and not strings.
I think this is not general enough. You could implement an onSubmitted or onEditingComplete callback to do what you want. The onSubmitted isn't implemented, yet. I am open for pull requests, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants