Skip to content

Commit 5010178

Browse files
sukhwinder33445nilmerg
authored andcommitted
Fix search suggestions 0px height
1 parent 1a4e460 commit 5010178

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

asset/js/widget/Completer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ define(["../notjQuery"], function ($) {
9292
let inputPosY = inputRect.bottom - containingBlockRect.top;
9393
let suggestionWidth = this.termSuggestions.offsetWidth;
9494

95-
let maxAvailableHeight = document.body.clientHeight - containingBlockRect.bottom;
96-
let localMarginTop = window.getComputedStyle(this.termSuggestions).marginTop;
95+
let maxAvailableHeight = document.body.clientHeight - inputRect.bottom;
96+
let localMarginBottom = window.getComputedStyle(this.termSuggestions).marginBottom;
9797

9898
this.termSuggestions.style.top = `${ inputPosY }px`;
99-
this.termSuggestions.style.maxHeight = `calc(${maxAvailableHeight}px - ${localMarginTop})`;
99+
this.termSuggestions.style.maxHeight = `calc(${maxAvailableHeight}px - ${localMarginBottom})`;
100100
if (inputPosX + suggestionWidth > containingBlockRect.right - containingBlockRect.left) {
101101
this.termSuggestions.style.left =
102102
`${ containingBlockRect.right - containingBlockRect.left - suggestionWidth }px`;

0 commit comments

Comments
 (0)