Cap object group card shared width

This commit is contained in:
2026-06-12 08:52:05 +02:00
parent e156e99b21
commit 74b47c1ccb
+3 -1
View File
@@ -117,7 +117,9 @@
} }
const referenceWidth = referenceCard.getBoundingClientRect().width; const referenceWidth = referenceCard.getBoundingClientRect().width;
grid.style.setProperty('--layout-object-card-shared-width', `${referenceWidth}px`); const maxWidth = parseFloat(getComputedStyle(referenceCard).maxWidth);
const sharedWidth = Number.isFinite(maxWidth) ? Math.min(referenceWidth, maxWidth) : referenceWidth;
grid.style.setProperty('--layout-object-card-shared-width', `${sharedWidth}px`);
grid.classList.add('sg-object-card-grid--multi-row'); grid.classList.add('sg-object-card-grid--multi-row');
}); });
}; };