We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eecbe48 commit 4d8a31fCopy full SHA for 4d8a31f
1 file changed
lib/ace/autocomplete/popup.js
@@ -206,9 +206,12 @@ var AcePopup = function(parentNode) {
206
};
207
popup.show = function(pos, lineHeight) {
208
var el = this.container;
209
- if (pos.top > window.innerHeight / 2 + lineHeight) {
+ var screenHeight = window.innerHeight;
210
+ var renderer = this.renderer;
211
+ var maxH = renderer.$maxLines * lineHeight;
212
+ if (pos.top +maxH > screenHeight - lineHeight) {
213
el.style.top = "";
- el.style.bottom = window.innerHeight - pos.top + "px";
214
+ el.style.bottom = screenHeight - pos.top + "px";
215
} else {
216
pos.top += lineHeight;
217
el.style.top = pos.top + "px";
0 commit comments