From 3df1407a05459ec8e628e9d11ff6c5d3c33b78f6 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Tue, 22 Oct 2024 18:18:52 +0000 Subject: [PATCH] fix type errors for new element APIs --- pxtblocks/polyfills.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pxtblocks/polyfills.ts b/pxtblocks/polyfills.ts index 36a8353d286..cfe519b20e6 100644 --- a/pxtblocks/polyfills.ts +++ b/pxtblocks/polyfills.ts @@ -1,6 +1,6 @@ export function applyPolyfills() { - if (!Element.prototype.checkVisibility) { - Element.prototype.checkVisibility = function checkVisibility(this: Element): boolean { + if (!(Element.prototype as any).checkVisibility) { + (Element.prototype as any).checkVisibility = function checkVisibility(this: Element): boolean { const computedStyle = getComputedStyle(this); // technically, this should also check for contentVisibility === "auto" and then @@ -10,7 +10,7 @@ export function applyPolyfills() { computedStyle.opacity === "0" || computedStyle.visibility === "hidden" || computedStyle.display === "none" || - computedStyle.contentVisibility === "hidden" + (computedStyle as any).contentVisibility === "hidden" ) { return false; }