fix: fix dialog modals

This commit is contained in:
Catriel Müller
2026-02-04 14:02:56 -03:00
parent e4163a0ff0
commit f278d21ee6
+13
View File
@@ -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,