question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Stepper] Mui-active / Mui-completed classes are not applied to icon container

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

CSS classes .Mui-active and .Mui-completed are not applied to MuiStepLabel iconContainer element. As a result, it’s not possible to change the iconContainer style using custom theme

Expected behavior 🤔

I would expect the .Mui-active and .Mui-completed classes to be applied to each elements of a step instead of just the label, or having any other class for applying style on each element of an active / completed step

Steps to reproduce 🕹

You can replicate the issue using this sandbox

Steps:

  1. Check demo.tsx. This is where the stepper is implemented
  2. Check index.tsx. This is where the theme is defined. On line 61, you’ll find the style to change step icon style
  3. Play around with steps. Only the label is colored
  4. Inspect the HTML on the active Icon. You will see that no CSS class is applied to make it active
  5. Inspect the HTML on the active label. You will see that the .Mui-active class is applied to make it active

Context 🔦

I’m building a stepper with icons that I want to style using custom theme (using JSS). The stepper looks like this: image

My goal is to apply a specific color/background color to the label and the icon of an active step in order to highlight it, just like this: image

To do so, I’m relying on the .Mui-active class applied on an active step. So far, this class is only applied to MuiStepLabel-label and not on MuiStepLabel-iconContainer As a result, I’m able to apply the color I want on the label itself using a theme, but I have no way to target an active iconContainer image

I experience the exact same behavior with .Mui-completed class

Your environment 🌎

npx @mui/envinfo
  Tested on Chrome, safari, Firefox
  
System:
    OS: macOS 12.4
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Edge: Not Found
    Firefox: 86.0
    Safari: 15.5
  npmPackages:
    @emotion/react: ^11.9.3 => 11.9.3 
    @emotion/styled: ^11.9.3 => 11.9.3 
    @mui/base:  5.0.0-alpha.86 
    @mui/codemod: ^5.8.4 => 5.8.5 
    @mui/envinfo: ^2.0.6 => 2.0.6 
    @mui/icons-material: ^5.8.4 => 5.8.4 
    @mui/lab: ^5.0.0-alpha.86 => 5.0.0-alpha.87 
    @mui/material: ^5.8.4 => 5.8.5 
    @mui/private-theming:  5.8.4 
    @mui/styled-engine:  5.8.0 
    @mui/styles: ^5.8.4 => 5.8.4 
    @mui/system:  5.8.5 
    @mui/types:  7.1.4 
    @mui/utils:  5.8.4 
    @mui/x-date-pickers: ^5.0.0-alpha.7 => 5.0.0-alpha.7 
    @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.4.3 => 4.7.4 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
noobyogi0010commented, Jul 7, 2022

Hey, @siriwatknp I would like to work on this issue if no one else is working on it. Thanks!

1reaction
Mark-777-0commented, Aug 1, 2022

We can both work on this if you’d like? I just fixed my typo, I’m trying some other things once I can get my local set up re-running.

Read more comments on GitHub >

github_iconTop Results From Across the Web

StepIcon API - Material UI - MUI
API reference docs for the React StepIcon component. Learn about the props, CSS, and other APIs of this exported module.
Read more >
MUI Stepper Icon not showing - Stack Overflow
However, when I try to do this, it just renders a blank screen without any content. I want to get this look (as...
Read more >
How to customize the icons of a Stepper in Material-UI React
Each step icons can be customized using a simple trick. In this post, I will show to how to customize the Stepper icons...
Read more >
React MUI StepLabel API - GeeksforGeeks
MuiStepLabel -alternativeLabel): It is the state class applied to the root and icon container and label if alternativeLabel is true.
Read more >
Material UI in React #7 - Stepper component with ... - YouTube
Hello fellow react devs! I am happy to share part number seven of the series. In today's episode you will learn how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found