final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.39k stars 481 forks source link

why auto complete behave like text field? #722

Open naveennsit opened 4 years ago

naveennsit commented 4 years ago

I am using material UI with react-final-form. I make two adapter text-field and Auto comlete using below link

https://material-ui.com/components/autocomplete/#autocomplete

but my auto complete list is not display why ? instead of that it behaves like a text field why

here is my code

https://codesandbox.io/s/react-final-form-third-party-components-example-bjqt6

const AutocompleteAdapter = ({ input, meta, ...rest }) => (
  <Autocomplete
    multiple
    {...rest}
    id="tags-standard"
    options={[
      { title: "The Shawshank Redemption", year: 1994 },
      { title: "The Godfather", year: 1972 }
    ]}
    getOptionLabel={option => option.title}
    renderInput={params => (
      <TextField
        {...params}
        {...input}
        variant="standard"
        label="Multiple values"
        placeholder="Favorites"
        onChange={(event, value) => input.onChange(value)}
        errorText={meta.touched ? meta.error : ""}
        fullWidth
      />
    )}
  />
);

when I type on favourite an complete Auto complete example it does not display list instead of it behaves like a text field ? why

InfiniteRandomVariable commented 4 years ago

Does this idea solve your problem? https://stackoverflow.com/questions/59832331/why-checkbox-is-not-checked-in-react?noredirect=1#comment105801358_59832331