mui / mui/material-ui

[Popover] Styled Components engine ignores sx property in slotProps

Open
#38,352 4 comments 1 reaction 1 assignee View on GitHub

@mnajdova is already working on this.

Since Aug 11, 2023.

component: Popover package: styled-engine-sc scope: popup type: bug
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/styled-components-forked-rcl437

Steps:

  1. Click on the Button to open the popover
Current behavior 😯

The background color of the Popover is white

Expected behavior 🤔

The background color of the Popover is red

Context 🔦

I'm trying to use Popover API to style my components, but the sx property in slotProps.paper is not working if I'm using the styled-components style engine.

Your environment 🌎
npx @mui/envinfo
  System:
    OS: Windows 10 10.0.22621
  Binaries:
    Node: 20.0.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 115
    Edge: Spartan (44.22621.1992.0), Chromium (115.0.1901.188)
  npmPackages:
    @mui/base:  5.0.0-beta.9
    @mui/core-downloads-tracker:  5.14.3
    @mui/material: ^5.14.3 => 5.14.3
    @mui/private-theming:  5.13.7
    @mui/styled-engine: ^5.13.2 => 5.13.2
    @mui/styled-engine-sc: ^5.12.0 => 5.12.0
    @mui/system:  5.14.3
    @mui/types:  7.2.4
    @mui/utils: ^5.14.3 => 5.14.3
    @mui/x-date-pickers:  5.0.20
    @mui/x-date-pickers-pro: ^5.0.4 => 5.0.20
    @mui/x-license-pro: ^6.9.0 => 6.10.2
    @types/react: ^18.2.18 => 18.2.18
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    styled-components: ^5.3.11 => 5.3.11
    typescript:  4.9.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.