From 74209457483eaa62aa7a04d65a2abdf869d8bebe Mon Sep 17 00:00:00 2001 From: pk Date: Sat, 2 Sep 2023 00:13:59 +0200 Subject: [PATCH] Add layout event --- package.json | 2 +- tp-popup.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 343cf3c..afd11e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-popup", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "tp-popup.js", "scripts": { diff --git a/tp-popup.js b/tp-popup.js index 9deffc5..2eb8954 100644 --- a/tp-popup.js +++ b/tp-popup.js @@ -195,11 +195,13 @@ class TpPopup extends EventHelpers(Position(DomQuery(LitElement))) { this._cleanupEvents(); this.listen(document, 'mousedown', '_docClick'); this.scrollTarget.addEventListener('scroll', this.fit, { passive: true }); + this.scrollTarget.addEventListener('layout', this.fit, { passive: true }); } _cleanupEvents() { this.unlisten(document, 'mousedown', '_docClick'); this.scrollTarget.removeEventListener('scroll', this.fit, { passive: true }); + this.scrollTarget.removeEventListener('layout', this.fit, { passive: true }); } }