[autocomplete] don't allow completions to overflow the box, or for the box to overflow the screen, see #999
This commit is contained in:
parent
ad4d9c74d4
commit
e0f5ce21a2
2 changed files with 2 additions and 0 deletions
|
@ -137,6 +137,7 @@ function renderCompletions(element) {
|
|||
element.parentNode.insertBefore(completions_el, element.nextSibling);
|
||||
let br = element.getBoundingClientRect();
|
||||
completions_el.style.minWidth = br.width + 'px';
|
||||
completions_el.style.maxWidth = 'calc(100vw - 2rem - ' + br.left + 'px)';
|
||||
completions_el.style.left = window.scrollX + br.left + 'px';
|
||||
completions_el.style.top = window.scrollY + (br.top + br.height) + 'px';
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
padding: 0;
|
||||
font-size: 1rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.autocomplete_completions LI {
|
||||
padding: 0.15em;
|
||||
|
|
Reference in a new issue