[material-ui][Select] Select has an unexisting "placeholder" props #43571
Labels
component: select
This is the name of the generic UI component, not the React module!
enhancement
This is not a bug, nor a new feature
package: material-ui
Specific to @mui/material
typescript
Steps to reproduce
Link to live example: (required)
Unfortunately the sandbox tells me the dependencies are missing somehow, although I followed the documentation guide on how to build a reproduction case. As a consequence, the bug is not reproduced. Here is the link in case it might help:
https://codesandbox.io/s/lingering-frog-n75572?file=/src/Demo.tsx:10-11
Current behavior
The Select component's type has a
placeholder
prop, however this property does not exist in theSelect
implementation. I have checked the documentation of v4, v5, v6 and could only find examples of implementing a placeholder by hand. I have not found anyplaceholder
prop. On top of that, adding aplaceholder
prop to theSelect
doesn't do anything.If my understanding is correct, the problem comes from the
BaseSelectProps
interface, which extends a portion ofInputProps
.InputProps
has aplaceholder
property. This property is not omitted in theInputProps
extension ofBaseSelectProps
, which as a consequence means theSelect
has aplaceholder
property:From
Select/Select.d.ts
, line 13:Expected behavior
The
Select
component must not have aplaceholder
prop.I suppose this is the right solution:
Context
No response
Your environment
System: OS: macOS 13.4 Binaries: Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node npm: 10.2.5 - ~/.nvm/versions/node/v20.9.0/bin/npm pnpm: 8.10.3 - /opt/homebrew/bin/pnpm Browsers: Chrome: 128.0.6613.86 Edge: Not Found Safari: 16.5 npmPackages: @emotion/react: ^11.11.1 => 11.11.1 @emotion/styled: ^11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.4 @mui/core-downloads-tracker: 6.0.1 @mui/icons-material: 5.15.11 => 5.15.11 @mui/lab: 5.0.0-alpha.134 => 5.0.0-alpha.134 @mui/material: 6.0.1 => 6.0.1 @mui/private-theming: 5.15.0 @mui/styled-engine: 5.15.0 @mui/styles: ^5.11.13 => 5.15.0 @mui/system: 5.15.0 @mui/types: 7.2.11 @mui/utils: 5.15.0 @mui/x-date-pickers: ^5.0.20 => 5.0.20 @types/react: ^18.0.28 => 18.2.45 react: ^18.2.0 => 18.2.0 react-dom: ^18.2.0 => 18.2.0 typescript: ^5.5.2 => 5.5.2
Search keywords: select, placeholder
The text was updated successfully, but these errors were encountered: