Config UI: fix card min height (#28977)

This commit is contained in:
Michael Geers 2026-04-09 17:49:00 +02:00 • committed by GitHub
parent 8eb7412a74
commit 411f194645
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
});
},