From 411f194645b522e6221fd7d588e8b57f8c59e628 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Thu, 9 Apr 2026 17:49:00 +0200 Subject: [PATCH] Config UI: fix card min height (#28977) --- assets/js/components/Config/DeviceCard.vue | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/assets/js/components/Config/DeviceCard.vue b/assets/js/components/Config/DeviceCard.vue index 7e0c1e4ac..3c5c18166 100644 --- a/assets/js/components/Config/DeviceCard.vue +++ b/assets/js/components/Config/DeviceCard.vue @@ -77,20 +77,17 @@ export default { const el = this.$refs.tagsContainer; const content = this.$refs.tagsContent; if (!el || !content) return; - const initialHeight = content.offsetHeight; - this.resizeObserver = new ResizeObserver(() => { - if (content.offsetHeight <= initialHeight) return; - const prev = el.style.minHeight; + const minContentHeight = 10; + const check = () => { + if (content.offsetHeight <= minContentHeight) return; + // measure natural height without cached min-height el.style.minHeight = ""; - const naturalHeight = Math.round(el.getBoundingClientRect().height); - el.style.minHeight = prev; - if (!this.tagsMinHeight || naturalHeight >= this.tagsMinHeight) { - settings.cardHeights[this.id] = naturalHeight; - this.tagsMinHeight = null; - this.resizeObserver?.disconnect(); - this.resizeObserver = null; - } - }); + settings.cardHeights[this.id] = Math.round(el.getBoundingClientRect().height); + this.tagsMinHeight = null; + this.resizeObserver?.disconnect(); + this.resizeObserver = null; + }; + this.resizeObserver = new ResizeObserver(check); this.resizeObserver.observe(content); }); },