Skip to content

Commit

Permalink
fix(popup): prevent crash on Legacy Edge when opening a popup (#6514)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpowa committed Jul 12, 2023
1 parent a51eb71 commit 7c07538
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/popup-dropdown-view-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export class PopupDropdownViewModel extends PopupBaseViewModel {
let actualHorizontalPosition = this.getActualHorizontalPosition();

if (!!window) {
height = Math.ceil(Math.min(height, window.innerHeight * 0.9, window.visualViewport.height));
const heightValues = [height, window.innerHeight * 0.9, window.visualViewport?.height];
height = Math.ceil(Math.min(...heightValues.filter((each) => typeof each === "number")));
verticalPosition = PopupUtils.updateVerticalPosition(
targetElementRect,
height,
Expand Down

0 comments on commit 7c07538

Please sign in to comment.