Add layout event
This commit is contained in:
parent
3af695daab
commit
7420945748
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tp/tp-popup",
|
"name": "@tp/tp-popup",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "tp-popup.js",
|
"main": "tp-popup.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -195,11 +195,13 @@ class TpPopup extends EventHelpers(Position(DomQuery(LitElement))) {
|
|||||||
this._cleanupEvents();
|
this._cleanupEvents();
|
||||||
this.listen(document, 'mousedown', '_docClick');
|
this.listen(document, 'mousedown', '_docClick');
|
||||||
this.scrollTarget.addEventListener('scroll', this.fit, { passive: true });
|
this.scrollTarget.addEventListener('scroll', this.fit, { passive: true });
|
||||||
|
this.scrollTarget.addEventListener('layout', this.fit, { passive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
_cleanupEvents() {
|
_cleanupEvents() {
|
||||||
this.unlisten(document, 'mousedown', '_docClick');
|
this.unlisten(document, 'mousedown', '_docClick');
|
||||||
this.scrollTarget.removeEventListener('scroll', this.fit, { passive: true });
|
this.scrollTarget.removeEventListener('scroll', this.fit, { passive: true });
|
||||||
|
this.scrollTarget.removeEventListener('layout', this.fit, { passive: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user