File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/@react-spectrum/toast/stories Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -264,15 +264,15 @@ function IframeExample() {
264
264
265
265
// Catch toasts inside the iframe and redirect them outside.
266
266
window . addEventListener ( 'react-spectrum-toast' , ( e ) => {
267
- e . preventDefault ( ) ;
268
- if ( e instanceof CustomEvent ) {
269
- ToastQueue [ e . detail . variant ] ( e . detail . children , e . detail . options ) ;
270
- }
267
+ let evt = e as CustomEvent ;
268
+ evt . preventDefault ( ) ;
269
+ ToastQueue [ evt . detail . variant ] ( evt . detail . children , evt . detail . options ) ;
271
270
} ) ;
272
271
273
272
let prevFocusedElement : HTMLElement | null = null ;
274
273
window . addEventListener ( 'react-aria-landmark-navigation' , ( e ) => {
275
- e . preventDefault ( ) ;
274
+ let evt = e as CustomEvent ;
275
+ evt . preventDefault ( ) ;
276
276
let el = document . activeElement ;
277
277
if ( el !== document . body ) {
278
278
prevFocusedElement = el as HTMLElement ;
@@ -283,7 +283,7 @@ function IframeExample() {
283
283
284
284
window . parent . postMessage ( {
285
285
type : 'landmark-navigation' ,
286
- direction : e instanceof CustomEvent ? e . detail . direction : undefined
286
+ direction : evt . detail . direction
287
287
} ) ;
288
288
289
289
setTimeout ( ( ) => {
You can’t perform that action at this time.
0 commit comments