Skip to content

Commit

Permalink
[Slider] Shouldn't be visible when in=false (mui#8894)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and the-noob committed Nov 17, 2017
1 parent 9c489fb commit 30431f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions src/transitions/Slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,6 @@ class Slide extends React.Component<ProvidedProps & Props, State> {
firstMount: true,
};

componentDidMount() {
if (!this.props.in) {
// We need to set initial translate values of transition element
// otherwise component will be shown when in=false.
const element = findDOMNode(this.transition);
if (element instanceof HTMLElement) {
element.style.visibility = 'visible';
setTranslateValue(this.props, element);
}
}
}

componentWillReceiveProps() {
this.setState({
firstMount: false,
Expand Down
4 changes: 2 additions & 2 deletions src/transitions/Slide.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ describe('<Slide />', () => {
</SlideNaked>,
);
const transition = findDOMNode(wrapper.instance().transition);
// $FlowFixMe
assert.notStrictEqual(transition.style.transform, undefined);
// $FlowExpectedError
assert.strictEqual(transition.style.visibility, 'hidden');
});
});

Expand Down

0 comments on commit 30431f2

Please sign in to comment.