Skip to content

Commit

Permalink
Merge pull request #5514 from surveyjs/bug/popup-position-add-checks
Browse files Browse the repository at this point in the history
Add checks on popup container update position
  • Loading branch information
OlgaLarina authored Jan 17, 2023
2 parents 8f7862e + 0dd2b79 commit 901eae0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/popup-dropdown-view-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export class PopupDropdownViewModel extends PopupBaseViewModel {
if(!this.targetElement) return;
const targetElementRect = this.targetElement.getBoundingClientRect();
const background = <HTMLElement>this.container.children[0];
if(!background) return;
const popupContainer = <HTMLElement>background.children[0];
const scrollContent = <HTMLElement>background.children[0].querySelector(".sv-popup__scrolling-content");
if(!popupContainer) return;
const scrollContent = <HTMLElement>popupContainer.querySelector(".sv-popup__scrolling-content");
const popupComputedStyle = window.getComputedStyle(popupContainer);
const marginLeft = (parseFloat(popupComputedStyle.marginLeft) || 0);
const marginRight = (parseFloat(popupComputedStyle.marginRight) || 0);
Expand Down

0 comments on commit 901eae0

Please sign in to comment.