Skip to content

Commit ff17ae1

Browse files
committed
fix bug 75742
1 parent 120810b commit ff17ae1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

common/loginpage/src/menu.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ Menu.prototype.show = function(pos, data) {
115115
pos.left -= (_right - _rlimit + 4);
116116
}
117117

118-
let _top = $dd.height() + pos.top,
119-
_blimit = $(document).height();
120-
if (!!this.config.bottomlimitoffset)
121-
_blimit -= this.config.bottomlimitoffset;
122-
if (!!_top && _top > _blimit) {
123-
pos.top -= (_top - _blimit + 4);
118+
const dropdownHeight = $dd.outerHeight();
119+
let documentHeight = $(document).height();
120+
if (!!this.config.bottomlimitoffset) {
121+
documentHeight -= this.config.bottomlimitoffset;
122+
}
123+
124+
if ((pos.top + dropdownHeight) > documentHeight) {
125+
pos.top = documentHeight - dropdownHeight - 4;
124126
}
125127

126128
$el.css(pos);

0 commit comments

Comments
 (0)