Skip to content

Commit

Permalink
fix stepper jump
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 13, 2020
1 parent 9bd9c55 commit ec5f8e6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/components/steppers/steppers.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ determine when all steps are completed (or even if they need to be completed).

{{"demo": "pages/components/steppers/HorizontalNonLinearStepper.js"}}

### Alternative Label
### Alternative label

Labels can be placed below the step icon by setting the `alternativeLabel` prop on the `Stepper` component.

Expand Down
17 changes: 16 additions & 1 deletion docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ const theme = createMuitheme({
/>
```

### Stepper
### Stepper

- The root component (Paper) was replaced with a div. Stepper no longer has elevation, nor inherits Paper's props. This change is meant to encourage composition.

Expand All @@ -543,6 +543,21 @@ const theme = createMuitheme({
+<Paper>
```

- Remove the built-in 24px padding.

```diff
-<Stepper>
- <Step>
- <StepLabel>Hello world</StepLabel>
- </Step>
-</Stepper>
+ <Stepper style={{ padding: 24 }}>
+ <Step>
+ <StepLabel>Hello world</StepLabel>
+ </Step>
+ </Stepper>
```

### TablePagination

- The customization of the table pagination's actions labels must be done with the `getItemAriaLabel` prop. This increases consistency with the `Pagination` component.
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/Collapse/Collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Collapse = React.forwardRef(function Collapse(props, ref) {
wrapperRef.current ? wrapperRef.current[isHorizontal ? 'clientWidth' : 'clientHeight'] : 0;

const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
if (wrapperRef.current) {
if (wrapperRef.current && isHorizontal) {
// Set absolute position to get the size of collapsed content
wrapperRef.current.style.position = 'absolute';
}
Expand All @@ -130,7 +130,7 @@ const Collapse = React.forwardRef(function Collapse(props, ref) {
const handleEntering = normalizedTransitionCallback((node, isAppearing) => {
const wrapperSize = getWrapperSize();

if (wrapperRef.current) {
if (wrapperRef.current && isHorizontal) {
// After the size is read reset the position back to default
wrapperRef.current.style.position = '';
}
Expand Down

0 comments on commit ec5f8e6

Please sign in to comment.