Opened 5 years ago

Last modified 3 years ago

#18101 assigned defect

popup.js miscalculates height unless position == "above", "below"

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.15
Component: Dijit Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

dijit/popup#open() has code to limit the height of a popup so it fits within the viewport. It works well in the common case where the positions to try are the default ["below", "below-alt", "above", "above-alt"].

However, if the positions are just ["below"], then it may make the dropdown too tall. See the popup.html test case, the "show tall drop down" button, after making your browser window small enough so that the button is near the bottom.

That button is configured to always put the drop down below the button, even when there's more room above the button than below it. However, this code in popup.js calculates the maximum height for the dropdown under the assumption that position == above *or* below:

maxHeight = Math.floor(Math.max(aroundPos.y, viewport.h - (aroundPos.y + aroundPos.h)));

Looks like it's also wrong when the position is "left" or "right" because in that case, it will make the height smaller than necessary.

Change History (2)

comment:1 Changed 4 years ago by dylan

Milestone: tbd1.12
Owner: set to bill
Status: newassigned

comment:2 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.