Skip to content

[Select] slotProps can't pass to backdrop component #38949

@ethaizone

Description

@ethaizone

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Before this code can work on previous version.
Here is version that it work before.

  • @mui/material@5.14.2
    • @mui/base@5.0.0-beta.8
<Select
  MenuProps={{
    slotProps: {
      root: {
        slotProps: {
          backdrop: {
            style: {
              backgroundColor: 'transparent',
            },
          },
        },
      },
    },
  }}
>
  ...
</Select>

Current behavior 😯

It can't work. It failed when I run tsc and it show type error in VS Code.

Expected behavior 🤔

I should be able to change style of backdrop when I use <Select> component.

Context 🔦

I want to change background color of backdrop to be transparent. I debug them already as component path is (Select -> SelectInput -> Menu -> Popover -> Modal -> Backdrop).

I think these PRs is root cause.

Your environment 🌎

npx @mui/envinfo
I use Chrome.

  System:
    OS: macOS 13.5.2
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
  Browsers:
    Chrome: 116.0.5845.187
    Edge: Not Found
    Safari: 16.6
  npmPackages:
    @emotion/react: ^11.11.1 => 11.11.1
    @emotion/styled: ^11.11.0 => 11.11.0
    @mui/base:  5.0.0-beta.14
    @mui/core-downloads-tracker:  5.14.8
    @mui/icons-material: ^5.14.8 => 5.14.8
    @mui/lab: ^5.0.0-alpha.143 => 5.0.0-alpha.143
    @mui/material: ^5.14.8 => 5.14.8
    @mui/private-theming:  5.14.8
    @mui/styled-engine:  5.14.8
    @mui/styles: ^5.14.7 => 5.14.7
    @mui/system:  5.14.8
    @mui/types:  7.2.4
    @mui/utils:  5.14.8
    @mui/x-tree-view:  6.0.0-alpha.0
    @types/react:  18.2.16
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: ^5.2.2 => 5.2.2

Metadata

Metadata

Assignees

Labels

scope: menuChanges related to the menu.scope: selectChanges related to the select.type: regressionA bug, but worse, it used to behave as expected.typescript

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions