Skip to content

Add chip when submitted from keyboard - #12

Open
North101 wants to merge 2 commits into
zsoerenm:mainfrom
North101:add_chip_onsubmit
Open

Add chip when submitted from keyboard#12
North101 wants to merge 2 commits into
zsoerenm:mainfrom
North101:add_chip_onsubmit

Conversation

@North101

@North101 North101 commented Jun 1, 2021

Copy link
Copy Markdown
Contributor

This adds a new chip when submitted from the keyboard by taking the 1st suggested value (if any exist).

@zsoerenm

zsoerenm commented Jun 2, 2021

Copy link
Copy Markdown
Owner

Thank you for your contribution. I like the idea to submit the most similar suggestion on submit when non is selected. I think, however, this should not be the default. Could you make this configurable?

@North101

North101 commented Jun 2, 2021

Copy link
Copy Markdown
Contributor Author

I've added the bool field addSuggestedOnSubmit.

@North101
North101 force-pushed the add_chip_onsubmit branch from 774ff88 to 272f2bf Compare June 3, 2021 18:18
@North101
North101 force-pushed the add_chip_onsubmit branch from 272f2bf to cb2612a Compare June 4, 2021 13:27
@hydeparkk

Copy link
Copy Markdown
Contributor

There is no need to create a separate function for this, function passed to fieldViewBuilder parameter has an argument called onFieldSubmitted which does exactly the same as yours function onSubmitted. The only change could be to make this configurable so it could looks like this:

onSubmitted: widget.addSuggestedOnSubmit ? (_) => onFieldSubmitted() : null,

@grlduarte

Copy link
Copy Markdown

Is there some update on this feature? Will it be merged at some point?

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

Successfully merging this pull request may close these issues.

4 participants