Skip to content

Commit

Permalink
Fix gridTemplateColumns
Browse files Browse the repository at this point in the history
  • Loading branch information
TsayAdobe committed Sep 23, 2024
1 parent edbe095 commit d30e442
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acrobat/blocks/prompt-card/prompt-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function createBlocks(element, blockArray, templateCfg) {
if (templateCfg.rows && parentNode.classList.contains('section')) {
const resizeObserver = new ResizeObserver(() => {
const computedStyle = window.getComputedStyle(parentNode);
if (computedStyle.gridTemplateColumns !== 'none') {
if (/^(\d+(\.\d+)?(px|fr|em|rem|%))( (\d+(\.\d+)?(px|fr|em|rem|%)))*$/.test(computedStyle.gridTemplateColumns)) {
const promptcards = [...parentNode.querySelectorAll('.prompt-card')];
const visibleCnt = computedStyle.gridTemplateColumns.split(' ').length * templateCfg.rows;
promptcards.forEach(
Expand Down

0 comments on commit d30e442

Please sign in to comment.