Autocomplete for text fields #6904
Unanswered
Radiergummi
asked this question in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a use case for a free-form text input where I would like to offer picking a previously used value. This means that when the user types into the field, I'd need to search the database for values starting with the user input, and update the suggestions with that list.
There is
->suggestions()
on the Text field, but a callable passed to that is only executed before the form is rendered, and suggestions are static. I could fetch all values in there, but the database is large and there are potentially a lot of results.I imagine there must be other use cases where live autocomplete would be helpful, right? So how about adding an
->autocomplete(Closure(string $input): string[])
to Text fields that is invoked on (debounced) keydown events?Beta Was this translation helpful? Give feedback.
All reactions