-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
Steps to reproduce
Steps:
- Example 1: Uses
props.InputPropsto pass through default input fields fromAutoComplete - Example 2: Uses
props.slotProps.inputwhich fails to pass through default input fields fromAutoComplete
Note: Observe how we have only changed references from props.InputProps → props.slotProps?.input between examples
- See rendered Example 1 and observe how there is the dropdown icon the the right of someOtherEndAdornment and clicking this icon successfully drops down the options
- See rendered Example 2 and observe how there is NO dropdown icon the the right of someOtherEndAdornment and clicking this icon fails to drop down the options
Current behavior
We construct a wrapper class around TextField which does some custom rendering of endAdornments. Using this custom TextField as the renderInput result for an AutoComplete will only be possible when referencing the deprecated props.InputProps.
This is because, when debugging we observed that the default AutoComplete props (which render the dropdown arrow etc) which get passed to the TextField component only exist in InputProps (which is deprecated) and not the newly recommended slotProps.Input.
In our examples because we're creating a wrapper around TextField, it seems impossible for us to be able to pass though these props without referencing a deprecated field.
Expected behavior
I would expect the props passed down via params.InputProps from AutoComplete's renderInput prop to also be accessible via a non deprecated prop (InputProps)
Context
We have made a wrapper component around TextField so we can pass multiple startAdornments and endAdornments at once and do some custom rendering around that. (Is basically the same as Mui's standard TextField except we have arguments startControls={[...]} and endControls={[...]}, the latter of which is in the live examples provided. We plumb these lists of controls through to start and end adornments respectfully).
We are also trying to clear out our deprecated references and can't seem to resolve this issue due to the details described above.
Your environment
npx @mui/envinfo
System:
OS: macOS 15.6.1
Binaries:
Node: 21.7.1 - /usr/local/bin/node
npm: 10.5.0 - /usr/local/bin/npm
pnpm: Not Found
Browsers:
Chrome: 140.0.7339.133
Edge: Not Found
Safari: 18.6
npmPackages:
@emotion/react: 11.14.0 => 11.14.0
@emotion/styled: 11.14.1 => 11.14.1
@mui/core-downloads-tracker: 7.3.2
@mui/icons-material: 7.3.2 => 7.3.2
@mui/lab: 7.0.0-beta.17 => 7.0.0-beta.17
@mui/material: 7.3.2 => 7.3.2
@mui/private-theming: 7.3.2
@mui/styled-engine: 7.3.2
@mui/system: 7.3.2 => 7.3.2
@mui/types: 7.4.6
@mui/utils: 7.3.1
@mui/x-data-grid: 8.11.1
@mui/x-data-grid-pro: 8.11.1 => 8.11.1
@mui/x-internals: 8.11.1
@mui/x-license: 8.11.1 => 8.11.1
@mui/x-telemetry: 8.11.0
@mui/x-virtualizer: 0.1.5
@types/react: 19.1.12 => 19.1.12
react: 19.1.1 => 19.1.1
react-dom: 19.1.1 => 19.1.1
typescript: 5.9.2 => 5.9.2
Search keywords: InputProps, deprecated, AutoComplete, slotProps, TextField
Order ID: 65425
Search keywords:
Metadata
Metadata
Assignees
Labels
Projects
Status