From f278d21ee6b57c0c71eb387a9780fcd23cde3dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Wed, 4 Feb 2026 14:02:56 -0300 Subject: [PATCH] fix: fix dialog modals --- packages/app/src/entry.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/app/src/entry.tsx b/packages/app/src/entry.tsx index aa52fa1e7cb..44131dddcd0 100644 --- a/packages/app/src/entry.tsx +++ b/packages/app/src/entry.tsx @@ -25,6 +25,19 @@ if (import.meta.env.DEV && !(root instanceof HTMLElement)) { throw new Error(message) } +// kilocode_change start +// Floating UI can call getComputedStyle with non-elements (e.g., null refs, virtual elements). +// This happens on all platforms (WebView2 on Windows, WKWebView on macOS), not just Windows. +const originalGetComputedStyle = window.getComputedStyle +window.getComputedStyle = ((elt: Element, pseudoElt?: string | null) => { + if (!(elt instanceof Element)) { + // Fall back to a safe element when a non-element is passed. + return originalGetComputedStyle(document.documentElement, pseudoElt ?? undefined) + } + return originalGetComputedStyle(elt, pseudoElt ?? undefined) +}) as typeof window.getComputedStyle +// kilocode_change end + const platform: Platform = { platform: "web", version: pkg.version,