From 7b32a2729e09c31778e9fb9f3c82f09586ddd499 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Fri, 13 Jan 2023 10:39:44 +0100 Subject: [PATCH] don't allow other click handlers to run in parent elements --- src/platform/web/ui/general/ErrorView.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platform/web/ui/general/ErrorView.ts b/src/platform/web/ui/general/ErrorView.ts index f44361c3..eb1e7838 100644 --- a/src/platform/web/ui/general/ErrorView.ts +++ b/src/platform/web/ui/general/ErrorView.ts @@ -28,7 +28,8 @@ export class ErrorView extends TemplateView { override render(t: Builder, vm: ErrorViewModel): ViewNode { const submitLogsButton = t.button({ className: "ErrorView_submit", - onClick: disableTargetCallback(async () => { + onClick: disableTargetCallback(async evt => { + evt.stopPropagation(); if (await vm.submitLogs()) { alert("Logs submitted!"); } else { @@ -38,7 +39,10 @@ export class ErrorView extends TemplateView { }, "Submit logs"); const closeButton = t.button({ className: "ErrorView_close", - onClick: () => vm.close(), + onClick: evt => { + evt.stopPropagation(); + vm.close(); + }, title: "Dismiss error" }); return t.div({