Fix page scroll issue in autocomplete-component
This commit is contained in:
1 parent
e1c340f4bc
commit
043b54fdd6
1 file changed
+2
-2
@@ -22,9 +22,9 @@ class Autocomplete {
|
|||||||
el.addEventListener("focus", () => {
|
el.addEventListener("focus", () => {
|
||||||
this.element = el;
|
this.element = el;
|
||||||
const domRect = el.getBoundingClientRect();
|
const domRect = el.getBoundingClientRect();
|
||||||
this.container.style.left = `${domRect.left}px`;
|
this.container.style.left = `${domRect.left + window.pageXOffset}px`;
|
||||||
this.container.style.width = `${domRect.width}px`;
|
this.container.style.width = `${domRect.width}px`;
|
||||||
this.container.style.top = `${domRect.bottom}px`;
|
this.container.style.top = `${domRect.bottom + window.pageYOffset}px`;
|
||||||
this.update();
|
this.update();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user