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
Introduce a new AutocompleteInput based on MUI Autocomplete #6924
Conversation
@@ -23,23 +23,8 @@ describe('<AutocompleteInput />', () => { | |||
resource: 'users', | |||
}; | |||
|
|||
it('should use a Downshift', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because we don't want to test mui autocomplete
@@ -645,37 +632,6 @@ describe('<AutocompleteInput />', () => { | |||
await waitFor(() => expect(queryAllByRole('option').length).toEqual(1)); | |||
}); | |||
|
|||
it('passes options.suggestionsContainerProps to the suggestions container', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mui autocomplete provide its own ways to customize the underlying components
@@ -694,60 +650,6 @@ describe('<AutocompleteInput />', () => { | |||
}); | |||
}); | |||
|
|||
it('should not render a LinearProgress if loading is true and a second has not passed yet', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mui autocomplete has its own loading mechanism. Maybe we should check we don't set its loading prop unless a second has passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you did it, am I wrong?
This pull request is being automatically deployed with Vercel (learn more). react-admin – ./examples/simple🔍 Inspect: https://vercel.com/marmelab/react-admin/9hDLVn7GPcfw2AVyC7MJ4wb1NwGv react-admin-storybook – ./🔍 Inspect: https://vercel.com/marmelab/react-admin-storybook/AnBNcNU69HiYkbb8qoLuSJUbri5Y [Deployment for 0bb5b2e failed] |
I see a UI bug in the Storybook: in the "inside Reference Input" srtory, when typing text, the choices are briefly emptied before being filled with matching choices. I think you should use the keepPreviousData option in useGetList (once it's handled by react-query, of course) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! 💯
@@ -694,60 +650,6 @@ describe('<AutocompleteInput />', () => { | |||
}); | |||
}); | |||
|
|||
it('should not render a LinearProgress if loading is true and a second has not passed yet', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you did it, am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Aníbal Svarcas <WiXSL@users.noreply.github.com>
Co-authored-by: Aníbal Svarcas <WiXSL@users.noreply.github.com>
@@ -662,17 +667,6 @@ import { AutocompleteInput, ReferenceInput } from 'react-admin'; | |||
</ReferenceInput> | |||
``` | |||
|
|||
Lastly, would you need to override the props of the suggestion's container (a `Popper` element), you can specify them using the `options.suggestionsContainerProps`. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since suggestionsContainerProps
was introduced by react-admin, shouldn't we clarify how to upgrade this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's in the MUI documentation, I don't think we should include it
The vercel deployment doesn't have the authors ArrayInput in Post form and lacks the User menu |
You have to log in with admin/password |
I was trying it locally and it caught my attention, you are right |
optionText
and leverage theinputText
prop we had in previous version