From c9efefb3ded59ddcbd1c4b0fb583839b14a8d2bc Mon Sep 17 00:00:00 2001 From: Daniel Heid Date: Mon, 4 Nov 2024 15:25:08 +0100 Subject: [PATCH 1/2] Fixes #724 --- src/converters/piral-blazor/src/events.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/converters/piral-blazor/src/events.ts b/src/converters/piral-blazor/src/events.ts index 90273caf0..7b8693017 100644 --- a/src/converters/piral-blazor/src/events.ts +++ b/src/converters/piral-blazor/src/events.ts @@ -67,8 +67,7 @@ function dispatchToRoot(event: any) { performInternalNavigation(event); } - // the mutation event cannot be cloned (at least in Webkit-based browsers) - if (!(event instanceof MutationEvent) && !event.processed) { + if (!event.processed) { const eventClone = new event.constructor(event.type, event); document.getElementById(blazorRootId)?.dispatchEvent(eventClone); // make sure to only process every event once; even though multiple boundaries might be active From 445bc8937094e3ad75543ad4996a4accec044323 Mon Sep 17 00:00:00 2001 From: Daniel Heid Date: Mon, 4 Nov 2024 17:02:32 +0100 Subject: [PATCH 2/2] Add event type check for older browsers (#724) --- src/converters/piral-blazor/src/events.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/converters/piral-blazor/src/events.ts b/src/converters/piral-blazor/src/events.ts index 7b8693017..a48da0703 100644 --- a/src/converters/piral-blazor/src/events.ts +++ b/src/converters/piral-blazor/src/events.ts @@ -67,7 +67,7 @@ function dispatchToRoot(event: any) { performInternalNavigation(event); } - if (!event.processed) { + if ((typeof MutationEvent === 'undefined' || !(event instanceof MutationEvent)) && !event.processed) { const eventClone = new event.constructor(event.type, event); document.getElementById(blazorRootId)?.dispatchEvent(eventClone); // make sure to only process every event once; even though multiple boundaries might be active