Skip to content

Conversation

@FlorianBurgevin
Copy link

Fix issue : #34418

  • Adding useFormControl to manage disabled prop in Autocomplete


let disabled = disabledProp;

if (typeof disabled === 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the formControlState helper instead of this. See for example how it is used in the InputBase component. We should also take into account the other properties that the useFormControl provides, like fullWidth and size and include them as well in the formControlState helper as a third argument alongside with the disabled prop.

Overall, the implementation in the InputBase should be a good reference.

Copy link
Author

@FlorianBurgevin FlorianBurgevin Sep 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree with the helper. @mnajdova

But i'm a bit lost about where i have to use the fcs values.
What about ownerState?
In renderInput ? InputProps ? inputProps?

Maybe we have to pass error and required props to ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fcs values should be used wherever the supported props are used directly currently. ownerState, renderInput, etc. fields should include fcs fields as well.

@michaldudak michaldudak added the scope: autocomplete Changes related to the autocomplete. This includes ComboBox. label Oct 12, 2022
@ZeeshanTamboli
Copy link
Member

I don't think this PR becomes applicable after Olivier's comment in #34418 (comment). We can show an example of using Autocomplete with Form Control in the docs instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: autocomplete Changes related to the autocomplete. This includes ComboBox.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants