-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Feature Request] Add Autocomplete component and introduce example of async call #9
Comments
@ajoslin103 integrating |
I understand! There aren't enough cycles in the day !! You are doing so much for me, if I can make it work I'll contribute it |
Autocomplete would be incredibly useful; I couldn't use this otherwise great project for my form because of not supporting Autocomplete which I needed :/ |
async autocomplete is all I needed but I still can't find the proper way to do this. :( |
This feature finally landed in version Please visit https://react-hook-form-material-ui.vercel.app/?path=/story/autocomplete--basic to see some basic use cases. |
@bryantobing12 a simple way to solve with with the current version (example with apollo-client hook). export function AsyncAutocomplete({ name, label, multiple, variables }: TermsSelectorProps) {
const { loading, data, error } = useQuery(DOCUMENT_QUERY)
if (error) {
return (
<Alert severity={'error'}>{error?.message}</Alert>
)
}
return (
<AutocompleteElement name={name}
loading={loading}
multiple={multiple}
label={label}
options={data?.term?.map(term => ({
id: term.id,
label: term.en
})) ?? []} />
)
} |
I don't know if you can do this...
Please consider somehow integrating https://www.npmjs.com/package/react-places-autocomplete, or: https://www.npmjs.com/package/material-ui-autocomplete-google-places,
I struggled through many different versions before finding one I could get working. (and it does work quite well once you get it going) The one I got working is a bit of a mess, I know you could do much better !!
It would be really nice for my form to have an address component whose data was gathered automatically
Thanks for your time and attention !
The text was updated successfully, but these errors were encountered: