Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/@react-spectrum/toast/stories/Toast.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ function IframeExample() {

// Catch toasts inside the iframe and redirect them outside.
window.addEventListener('react-spectrum-toast', (e) => {
e.preventDefault();
if (e instanceof CustomEvent) {
ToastQueue[e.detail.variant](e.detail.children, e.detail.options);
}
let evt = e as CustomEvent;
evt.preventDefault();
ToastQueue[evt.detail.variant](evt.detail.children, evt.detail.options);
});

let prevFocusedElement: HTMLElement | null = null;
window.addEventListener('react-aria-landmark-navigation', (e) => {
e.preventDefault();
let evt = e as CustomEvent;
evt.preventDefault();
let el = document.activeElement;
if (el !== document.body) {
prevFocusedElement = el as HTMLElement;
Expand All @@ -283,7 +283,7 @@ function IframeExample() {

window.parent.postMessage({
type: 'landmark-navigation',
direction: e instanceof CustomEvent ? e.detail.direction : undefined
direction: evt.detail.direction
});

setTimeout(() => {
Expand Down