diff --git a/src/modules/Transition/Transition.d.ts b/src/modules/Transition/Transition.d.ts index ba60799843..f5b036a519 100644 --- a/src/modules/Transition/Transition.d.ts +++ b/src/modules/Transition/Transition.d.ts @@ -59,7 +59,7 @@ export interface TransitionProps { reactKey?: string; /** Run the enter animation when the component mounts, if it is initially shown. */ - transitionAppear?: boolean; + transitionOnShow?: boolean; /** Unmount the component (remove it from the DOM) when it is not shown. */ unmountOnHide?: boolean; diff --git a/src/modules/Transition/Transition.js b/src/modules/Transition/Transition.js index 18e861a42c..f5cc8dcd8f 100644 --- a/src/modules/Transition/Transition.js +++ b/src/modules/Transition/Transition.js @@ -69,7 +69,7 @@ export default class Transition extends Component { reactKey: PropTypes.string, /** Run the enter animation when the component mounts, if it is initially shown. */ - transitionAppear: PropTypes.bool, + transitionOnShow: PropTypes.bool, /** Unmount the component (remove it from the DOM) when it is not shown. */ unmountOnHide: PropTypes.bool, @@ -80,7 +80,7 @@ export default class Transition extends Component { duration: 500, visible: true, mountOnShow: true, - transitionAppear: false, + transitionOnShow: false, unmountOnHide: false, } @@ -219,12 +219,12 @@ export default class Transition extends Component { const { visible, mountOnShow, - transitionAppear, + transitionOnShow, unmountOnHide, } = this.props if (visible) { - if (transitionAppear) { + if (transitionOnShow) { return { initial: Transition.EXITED, next: Transition.ENTERING, diff --git a/src/modules/Transition/TransitionGroup.js b/src/modules/Transition/TransitionGroup.js index 0dacd5e215..d1972ef5a9 100644 --- a/src/modules/Transition/TransitionGroup.js +++ b/src/modules/Transition/TransitionGroup.js @@ -78,9 +78,9 @@ export default class TransitionGroup extends React.Component { } // item hasn't changed transition states, copy over the last transition props; - const { props: { visible, transitionAppear } } = prevChild + const { props: { visible, transitionOnShow } } = prevChild - children[key] = cloneElement(child, { visible, transitionAppear }) + children[key] = cloneElement(child, { visible, transitionOnShow }) }) this.setState({ children }) @@ -98,7 +98,7 @@ export default class TransitionGroup extends React.Component { }) } - wrapChild = (child, transitionAppear = false) => { + wrapChild = (child, transitionOnShow = false) => { const { animation, duration } = this.props const { key } = child @@ -110,7 +110,7 @@ export default class TransitionGroup extends React.Component { key={key} onHide={this.handleOnHide} reactKey={key} - transitionAppear={transitionAppear} + transitionOnShow={transitionOnShow} /> ) } diff --git a/test/specs/modules/Transition/Transition-test.js b/test/specs/modules/Transition/Transition-test.js index 0c04f343d1..9fb0949774 100644 --- a/test/specs/modules/Transition/Transition-test.js +++ b/test/specs/modules/Transition/Transition-test.js @@ -27,7 +27,7 @@ describe('Transition', () => { SUI.DIRECTIONAL_TRANSITIONS.forEach(animation => { it(`directional ${animation}`, () => { wrapperShallow( - +

) @@ -45,7 +45,7 @@ describe('Transition', () => { SUI.STATIC_TRANSITIONS.forEach(animation => { it(`static ${animation}`, () => { wrapperShallow( - +

) @@ -74,14 +74,14 @@ describe('Transition', () => { }) it('adds classes when ENTERED', () => { - wrapperShallow(

) + wrapperShallow(

) wrapper.should.have.className('visible') wrapper.should.have.className('transition') }) it('adds classes when ENTERING', () => { - wrapperShallow(

) + wrapperShallow(

) wrapper.setState({ animating: true, status: Transition.ENTERING }) wrapper.should.have.className('animating') @@ -98,7 +98,7 @@ describe('Transition', () => { }) it('adds classes when EXITING', () => { - wrapperShallow(

) + wrapperShallow(

) wrapper.setState({ animating: true, status: Transition.EXITING }) wrapper.should.have.className('animating') @@ -179,7 +179,7 @@ describe('Transition', () => { describe('visible', () => { it('updates status when set to false while ENTERING', () => { - wrapperShallow(

) + wrapperShallow(

) wrapper.setState({ status: Transition.ENTERING }) wrapper.setProps({ visible: false }) @@ -188,7 +188,7 @@ describe('Transition', () => { it('updates status when set to false while ENTERED', () => { wrapperShallow( - +

) @@ -213,7 +213,7 @@ describe('Transition', () => { wrapperMount(

@@ -255,7 +255,7 @@ describe('Transition', () => {

@@ -279,7 +279,7 @@ describe('Transition', () => {

@@ -304,7 +304,7 @@ describe('Transition', () => {

@@ -328,7 +328,7 @@ describe('Transition', () => {

@@ -349,10 +349,10 @@ describe('Transition', () => { }) }) - describe('transitionAppear', () => { + describe('transitionOnShow', () => { it('sets statuses when is true', () => { wrapperShallow( - +

) @@ -363,7 +363,7 @@ describe('Transition', () => { it('updates status after mount when is true', () => { wrapperMount( - +

).should.have.state('status', Transition.ENTERING) @@ -381,7 +381,7 @@ describe('Transition', () => {

@@ -400,7 +400,7 @@ describe('Transition', () => {

diff --git a/test/specs/modules/Transition/TransitionGroup-test.js b/test/specs/modules/Transition/TransitionGroup-test.js index 1b7dd6b3c3..e7e5aa21da 100644 --- a/test/specs/modules/Transition/TransitionGroup-test.js +++ b/test/specs/modules/Transition/TransitionGroup-test.js @@ -48,7 +48,7 @@ describe('TransitionGroup', () => { }) }) - it('wraps new child to Transition and sets transitionAppear to true', () => { + it('wraps new child to Transition and sets transitionOnShow to true', () => { wrapperShallow(

@@ -59,7 +59,7 @@ describe('TransitionGroup', () => { const child = wrapper.childAt(1) child.key().should.equal('.$second') child.type().should.equal(Transition) - child.should.have.prop('transitionAppear', true) + child.should.have.prop('transitionOnShow', true) }) it('skips invalid children', () => {