mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.49k stars 32.16k forks source link

[Autocomplete] Allow the user to remove the textarea warning #41669

Open adriancuadrado opened 6 months ago

adriancuadrado commented 6 months ago

Summary

I want to be able to remove this warning:

A textarea element was provided to Autocomplete where input was expected.
This is not a supported scenario but it may work under certain conditions.
A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).
Make sure to test keyboard navigation and add custom event handlers if necessary.

In React, when you add the contentEditable, you get a warning in the console that warns you about the problems you might encounter using that prop. To remove that warning you have to add another prop: suppressContentEditableWarning.

I want something similar to remove the textarea warning. Ideally, the warning message itself should also tell you about this new prop to remove it.

Examples

<Autocomplete
  options={yourOptions}
  renderInput={(params) => <TextField {...params} multiline />}
  suppressTextareaWarning
/>

Motivation

https://github.com/mui/material-ui/issues/29961

Search keywords: remove textarea warning autocomplete

ZeeshanTamboli commented 1 month ago

If anyone wants to work on it, see the discussion in #41671