From 69e85f21f890cbc68f6763ad4e88316ac75d6532 Mon Sep 17 00:00:00 2001 From: Wendelin Date: Mon, 16 Sep 2024 14:04:17 +0200 Subject: [PATCH] Fix polyfill handleOpen in ha-md-dialog --- src/components/ha-md-dialog.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/ha-md-dialog.ts b/src/components/ha-md-dialog.ts index 72b99f606fd1..3a055ec145da 100644 --- a/src/components/ha-md-dialog.ts +++ b/src/components/ha-md-dialog.ts @@ -37,14 +37,10 @@ export class HaMdDialog extends MdDialog { } } + // prevent open in older browsers and wait for polyfill to load private async _handleOpen(openEvent: Event) { - // prevent open in older browsers and wait for polyfill to load - if ( - typeof HTMLDialogElement !== "function" && - !this._polyfillDialogRegistered - ) { - openEvent.preventDefault(); - + openEvent.preventDefault(); + if (!this._polyfillDialogRegistered) { this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css"); const dialog = this.shadowRoot?.querySelector( "dialog"