Cap object group card shared width
This commit is contained in:
@@ -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');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user