Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
ethaizone opened this issue Sep 13, 2023 · 3 comments 路 Fixed by #39177
Closed
2 tasks done

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

ethaizone opened this issue Sep 13, 2023 · 3 comments 路 Fixed by #39177
Assignees
Labels
component: menu This is the name of the generic UI component, not the React module! component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse typescript

Comments

@ethaizone
Copy link

ethaizone commented Sep 13, 2023

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
@ethaizone ethaizone added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 13, 2023
@zannager zannager added the component: select This is the name of the generic UI component, not the React module! label Sep 13, 2023
@Zach-Jaensch
Copy link

I ran into the same issue. You can use the deprecated BackdropProps https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Modal/Modal.d.ts#L49C11-L49C11 as a work around, but this really needs fixing if we are expected to use the slots API (which worked in 5.10.13, not sure when it broke).

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Sep 23, 2023

The type error occurs since v5.14.3. It works in v5.14.2(CodeSandbox) but errors in v5.14.3(CodeSandbox). Looks like a regression from #37902 which was released in version 5.14.3.

@DiegoAndai Can you take a look?

@ZeeshanTamboli ZeeshanTamboli added component: menu This is the name of the generic UI component, not the React module! typescript package: material-ui Specific to @mui/material regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 23, 2023
@DiegoAndai
Copy link
Member

I'll take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants