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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[styles] Rendering in shadow dom after upgrade to v5 #24204

Closed
2 tasks done
natezhengbne opened this issue Dec 31, 2020 · 5 comments
Closed
2 tasks done

[styles] Rendering in shadow dom after upgrade to v5 #24204

natezhengbne opened this issue Dec 31, 2020 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@natezhengbne
Copy link

Some components will lose part of styles after the version was updated to v5.

  • The issue is present in the latest release(@material-ui/core 5.0.0.alpha-21)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

version 5 -> the blue label will lose the font style on v5.

image

Expected Behavior 🤔

The expected result is that the component has the font style as the same as the below picture from version 4.

image

Steps to Reproduce 🕹

Sandbox showing the font style included in with @material-ui/core 4.11.2: https://codesandbox.io/s/material-demo-forked-5lveb?file=/arrival-label.tsx

Sandbox showing the font style lost with @material-ui/core 5.0.0-alpha-21: https://codesandbox.io/s/material-demo-forked-bioll?file=/TemporaryDrawerLoseFocus.tsx

Context 🔦

The issue comes out after the material-ui updated to v5.

Your Environment 🌎

`npx @material-ui/envinfo`
    System:
    OS: Windows 10 10.0.19041
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\opt\Yarn\bin\yarn.CMD
    npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 87.0.4280.88
    Edge: Spartan (44.19041.423.0), Chromium (87.0.664.66)
  npmPackages:
    @emotion/react: ^11.1.3 => 11.1.3
    @emotion/styled: ^11.0.0 => 11.0.0
    @material-ui/core: ^5.0.0-alpha.19 => 5.0.0-alpha.19
    @material-ui/envinfo: ^1.0.0 => 1.0.0
    @material-ui/icons: ^4.11.2 => 4.11.2
    @material-ui/pickers: ^3.2.10 => 3.2.10
    @material-ui/styled-engine:  5.0.0-alpha.19
    @material-ui/system:  5.0.0-alpha.19
    @material-ui/types:  5.1.1
    @material-ui/unstyled:  5.0.0-alpha.19
    @material-ui/utils:  5.0.0-alpha.19
    @types/react: ^17.0.0 => 17.0.0
    react: ^17.0.1 => 17.0.1
    react-dom: ^17.0.1 => 17.0.1
    typescript: ^4.1.3 => 4.1.3
@natezhengbne natezhengbne added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 31, 2020
@natezhengbne natezhengbne changed the title [Styles] UI-components lose styles after upgrade to version 5 [Styles] The components lose styles after upgrade to v5 Dec 31, 2020
@oliviertassinari oliviertassinari added the package: styled-engine Specific to @mui/styled-engine label Dec 31, 2020
@n8sabes n8sabes mentioned this issue Dec 31, 2020
1 task
@n8sabes
Copy link

n8sabes commented Dec 31, 2020

Fab and other button components lose their style with 5.0.0-alpha.21 (#12032). Downgrading to alpha.20 resolves the problem for now.

@mnajdova mnajdova reopened this Dec 31, 2020
@oliviertassinari oliviertassinari added v5.x migration and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 31, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 31, 2020

Related to rendering the components in a different mounting point, e.g. #24097 (comment).

@mnajdova
Copy link
Member

Similarly to how you have a code for injecting the JSS styles in different mounting point, you need to do the same with emotion. Here is a working example: https://codesandbox.io/s/material-demo-forked-uypm3?file=/index.tsx

@oliviertassinari oliviertassinari changed the title [Styles] The components lose styles after upgrade to v5 [styles] Rendering in shadow dom after upgrade to v5 Dec 31, 2020
@oliviertassinari
Copy link
Member

Duplicate of #24109

@oliviertassinari oliviertassinari marked this as a duplicate of #24109 Dec 31, 2020
@github-actions github-actions bot added the duplicate This issue or pull request already exists label Dec 31, 2020
@oliviertassinari oliviertassinari removed package: styled-engine Specific to @mui/styled-engine v5.x migration labels Jan 7, 2021
@TrySpace
Copy link
Contributor

TrySpace commented Nov 6, 2021

For people with a similar issue, I solved it by removing package lock files and the old @material-ui packages from package.json. Then deleted the /node_modules folder and reinstalled everything. Then everything looked good again (I had a square Fab again: #12032)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants