mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix: fix dialog modals
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user