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

StepButton of non-linear horizontal Stepper protrudes into content #11857

Closed
2 tasks done
PutziSan opened this issue Jun 14, 2018 · 2 comments · Fixed by #17374
Closed
2 tasks done

StepButton of non-linear horizontal Stepper protrudes into content #11857

PutziSan opened this issue Jun 14, 2018 · 2 comments · Fixed by #17374
Labels
bug 🐛 Something doesn't work component: stepper This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@PutziSan
Copy link

PutziSan commented Jun 14, 2018

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Button ends where content starts. (see sandbox)

Capture d’écran 2019-07-13 à 21 16 10

Current Behavior

Button overflows

Capture d’écran 2019-07-13 à 21 16 06

Steps to Reproduce (for bugs)

https://codesandbox.io/s/p9nkwkyynq (press the buttons in the left stepper, the ripple-effect protrudes into the content)

Your Environment

see sandbox

I added a workaround-example in the sandbox to get the my expected behavior for now.

@oliviertassinari oliviertassinari added the component: stepper This is the name of the generic UI component, not the React module! label Jun 14, 2018
@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Jun 28, 2019
@eps1lon
Copy link
Member

eps1lon commented Jun 29, 2019

Recommended workaround using themes:

const theme = createMuiTheme({
  overrides: {
    MuiStepButton: {
      // remove the faulty spacing
      root: {
        margin: null,
        padding: null,
      },
      // which should only apply to `horizontal`
      horizontal: {
        padding: '24px 16px',
        margin: '-24px -16px',
      },
      // and be a bit more conservative with the spacing for `vertical`
      vertical: {
        padding: 8,
      },
    },
  },
});

We're trying to figure out if we can apply the fix to the core component but we risk breaking changes for other customizations.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 13, 2019

@PutziSan It seems that we could fix the problem with:

diff --git a/packages/material-ui/src/StepButton/StepButton.js b/packages/material-ui/src/StepButton/StepButton.js
index 7572b0bb2..dd898896b 100644
--- a/packages/material-ui/src/StepButton/StepButton.js
+++ b/packages/material-ui/src/StepButton/StepButton.js
@@ -19,6 +19,8 @@ export const styles = {
   /* Styles applied to the root element if `orientation="vertical"`. */
   vertical: {
     justifyContent: 'flex-start',
+    padding: '8px',
+    margin: '-8px',
   },
   /* Styles applied to the `ButtonBase` touch-ripple. */
   touchRipple: {

https://codesandbox.io/s/material-demo-im6qj

@oliviertassinari oliviertassinari added the good first issue Great for first contributions. Enable to learn the contribution process. label Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: stepper This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
3 participants