File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -231,11 +231,11 @@ const defaultProps = {
231
231
232
232
/* eslint-disable no-use-before-define, react/no-multi-comp */
233
233
function DialogTransition ( props ) {
234
- return < Fade { ...props } /> ;
234
+ return < Fade { ...props } timeout = { null } /> ;
235
235
}
236
236
237
237
function BackdropTransition ( props ) {
238
- return < Fade { ...props } /> ;
238
+ return < Fade { ...props } timeout = { null } /> ;
239
239
}
240
240
241
241
/* eslint-enable no-use-before-define */
Original file line number Diff line number Diff line change @@ -276,6 +276,28 @@ describe('<Modal>', () => {
276
276
) ;
277
277
} ) ;
278
278
279
+ it ( 'should call `transitionend` before `exited`' , ( done ) => {
280
+ const increment = sinon . spy ( ) ;
281
+ let modal ;
282
+
283
+ const instance = mount (
284
+ < Modal
285
+ show
286
+ style = { { transition : 'opacity 1s linear' } }
287
+ onExited = { ( ) => {
288
+ expect ( increment . callCount ) . to . equal ( 1 ) ;
289
+ modal . removeEventListener ( 'transitionend' , increment ) ;
290
+ done ( ) ;
291
+ } }
292
+ >
293
+ < strong > Message</ strong >
294
+ </ Modal > ,
295
+ ) ;
296
+ modal = instance . find ( '.modal' ) . getDOMNode ( ) ;
297
+ modal . addEventListener ( 'transitionend' , increment ) ;
298
+ instance . setProps ( { show : false } ) ;
299
+ } ) ;
300
+
279
301
describe ( 'cleanup' , ( ) => {
280
302
let offSpy ;
281
303
You can’t perform that action at this time.
0 commit comments