Skip to content

Commit

Permalink
fix type errors for new element APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
riknoll committed Oct 22, 2024
1 parent 133bcdd commit 3df1407
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pxtblocks/polyfills.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit 3df1407

Please sign in to comment.