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

Autocomplete freeSolo type seems broken #340

Open
2 tasks done
finn-rapid-data opened this issue Dec 30, 2024 · 0 comments
Open
2 tasks done

Autocomplete freeSolo type seems broken #340

finn-rapid-data opened this issue Dec 30, 2024 · 0 comments

Comments

@finn-rapid-data
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

We are thanksful users of the library and are using quite some components to unify MUI and RHF. We've built an abstraction function that uses the AutocompleteElement and does some styling around it, so nothing special.
As Properties, we wanted to use the built in AutocompleteElementProps type. However, when we want to use the freeSolo property on the autocompleteProps, we get an error stating that only false and undefined may be applied.
We've currently built a fix by explicitly defining the generic extended types, however we thought it would be cool to fix that for everyone as it seems to be a minor issue.
We hope that just removing the default value of false, which shouldn't be explicitly needed, would do the trick but are of course open to everything else that might fix that hiccup.
We are currently using version 7.4.0, but we also tried 7.4.1 which still seems to have that issue. Thanks a lot in advance!

Screenshot 2024-12-30 at 15 57 30 image

Expected behavior 🤔

The freeSolo type in the autocompleteProps should be boolean and not false | undefined.

Steps to reproduce 🕹

Steps:

  1. Create a wrapper component using the AutocompleteElementProps type from react-hook-form-mui as property type.
  2. Use the wrapper component and pass autocompleteProps={{ freeSolo: true }}
  3. A Typescript error should appear.
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

1 participant