Skip to content

Commit

Permalink
Try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Jun 24, 2024
1 parent 2f8136b commit 95997b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ export class Question extends SurveyElement<Question>
if (!!el && this.isDefaultRendering()) {
const scrollableSelector = this.getObservedElementSelector();
if (!scrollableSelector) return;
const defaultRootEl: HTMLElement = el.querySelector(scrollableSelector) || el.matches(scrollableSelector) && el;
const defaultRootEl: HTMLElement = el.querySelector(scrollableSelector) || el as any != window && el.matches(scrollableSelector) && el;
if (!defaultRootEl) return;
let isProcessed = false;
let requiredWidth: number = undefined;
Expand All @@ -2537,7 +2537,7 @@ export class Question extends SurveyElement<Question>
isProcessed = false;
}
const callback = () => {
const rootEl: HTMLElement = el.querySelector(scrollableSelector) || el.matches(scrollableSelector) && el;
const rootEl: HTMLElement = el.querySelector(scrollableSelector) || el as any != window && el.matches(scrollableSelector) && el;
if (!requiredWidth && this.isDefaultRendering()) {
requiredWidth = rootEl.scrollWidth;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function classesToSelector(str: string): string {
}

function getElementWidth(el: HTMLElement) {
return el as any != window && !!getComputedStyle ? Number.parseFloat(getComputedStyle(el).width) : el.offsetWidth;
return !!getComputedStyle ? Number.parseFloat(getComputedStyle(el).width) : el.offsetWidth;
}

function isContainerVisible(el: HTMLElement) {
Expand Down

0 comments on commit 95997b6

Please sign in to comment.