@@ -56,11 +56,14 @@ export default class Modal extends Component<Props, State> {
5656 { duration : 250 , easing : 'ease' } ,
5757 ) ;
5858 // animate modal::backdrop
59- animateTo ( this . dialogElement , [ { opacity : 0 } , { opacity : 1 } ] , {
60- duration : 250 ,
61- easing : 'linear' ,
62- pseudoElement : '::backdrop' ,
63- } ) ;
59+ // some browsers don't support ::backdrop, catch those errors
60+ try {
61+ animateTo ( this . dialogElement , [ { opacity : 0 } , { opacity : 1 } ] , {
62+ duration : 250 ,
63+ easing : 'linear' ,
64+ pseudoElement : '::backdrop' ,
65+ } ) ;
66+ } catch ( e ) { }
6467 this . setState ( { shown : true } ) ;
6568 }
6669
@@ -75,11 +78,14 @@ export default class Modal extends Component<Props, State> {
7578 { duration : 250 , easing : 'ease' } ,
7679 ) ;
7780 // animate modal::backdrop
78- animateTo ( this . dialogElement , [ { opacity : 0 } ] , {
79- duration : 250 ,
80- easing : 'linear' ,
81- pseudoElement : '::backdrop' ,
82- } ) ;
81+ // some browsers don't support ::backdrop, catch those errors
82+ try {
83+ animateTo ( this . dialogElement , [ { opacity : 0 } ] , {
84+ duration : 250 ,
85+ easing : 'linear' ,
86+ pseudoElement : '::backdrop' ,
87+ } ) ;
88+ } catch ( e ) { }
8389 anim . onfinish = this . _closeOnTransitionEnd ;
8490 }
8591
0 commit comments