fix: align overlay dynamically
parent
b606675dbb
commit
6164ac4601
|
@ -97,7 +97,6 @@ export default {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
onEnter(el) {
|
onEnter(el) {
|
||||||
this.alignOverlay();
|
|
||||||
this.bindOutsideClickListener();
|
this.bindOutsideClickListener();
|
||||||
this.bindScrollListener();
|
this.bindScrollListener();
|
||||||
this.bindResizeListener();
|
this.bindResizeListener();
|
||||||
|
@ -133,6 +132,8 @@ export default {
|
||||||
this.outsideClickListener = (event) => {
|
this.outsideClickListener = (event) => {
|
||||||
if (this.visible && this.container && !this.container.contains(event.target) && !this.isTargetClicked(event)) {
|
if (this.visible && this.container && !this.container.contains(event.target) && !this.isTargetClicked(event)) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
} else {
|
||||||
|
this.alignOverlay();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
document.addEventListener('click', this.outsideClickListener);
|
document.addEventListener('click', this.outsideClickListener);
|
||||||
|
|
Loading…
Reference in New Issue