From 6c999d10c376ad553fc82edb70558affec686bd2 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 29 Mar 2021 19:20:21 +0200 Subject: [PATCH] web/elements: trigger refresh on successful modalform submit Signed-off-by: Jens Langhammer --- web/src/elements/forms/ModalForm.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/elements/forms/ModalForm.ts b/web/src/elements/forms/ModalForm.ts index 488e4ebcf..fd26b0f6a 100644 --- a/web/src/elements/forms/ModalForm.ts +++ b/web/src/elements/forms/ModalForm.ts @@ -1,5 +1,6 @@ import { gettext } from "django"; import { customElement, html, TemplateResult } from "lit-element"; +import { EVENT_REFRESH } from "../../constants"; import { ModalButton } from "../buttons/ModalButton"; import { Form } from "./Form"; @@ -14,6 +15,12 @@ export class ModalForm extends ModalButton { } formPromise.then(() => { this.open = false; + this.dispatchEvent( + new CustomEvent(EVENT_REFRESH, { + bubbles: true, + composed: true, + }) + ); }).catch((e) => { console.log(e); });