Skip to content

Commit 4046f4e

Browse files
made a commit to fix issue with progress bar in safari in df4191d but only did frontend.
Also applying the fix to the editor https://stellarwp.atlassian.net/browse/KAD-5239
1 parent 288a0d5 commit 4046f4e

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/blocks/progress-bar/edit.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,24 @@ export function Edit(props) {
566566
const maskPositionArray = iterations > 1 ? range(0, 100.1, 100 / (iterations - 1)) : [0];
567567
const maskPositionString = (maskPositionArray.join('%,') + '%').replace(/(^,)|(,$)/g, '');
568568
const maskAspectRatioString = iterations + '/1';
569-
const maskHeightString = progressWidth ? progressWidth * 11.5 + 'px' : '80px';
570-
const maskHeightStringTablet = progressWidthTablet ? progressWidthTablet * 11.5 + 'px' : '';
571-
const maskHeightStringMobile = progressWidthMobile ? progressWidthMobile * 11.5 + 'px' : '';
569+
const maskHeight = progressWidth ? progressWidth * 11.5 : 80;
570+
const maskHeightTablet = progressWidthTablet ? progressWidthTablet * 11.5 : 0;
571+
const maskHeightMobile = progressWidthMobile ? progressWidthMobile * 11.5 : 0;
572+
const maskHeightString = maskHeight ? maskHeight + 'px' : '80px';
573+
const maskHeightStringTablet = maskHeightTablet ? maskHeightTablet + 'px' : '';
574+
const maskHeightStringMobile = maskHeightMobile ? maskHeightMobile + 'px' : '';
575+
const maskWidth = maskHeight * iterations;
576+
const maskWidthTablet = maskHeightTablet ? maskHeightTablet * iterations : 0;
577+
const maskWidthMobile = maskHeightMobile ? maskHeightMobile * iterations : 0;
578+
const maskWidthString = maskWidth + 'px';
579+
const maskWidthStringTablet = maskWidthTablet ? maskWidthTablet + 'px' : '';
580+
const maskWidthStringMobile = maskWidthMobile ? maskWidthMobile + 'px' : '';
581+
const previewMaskWidthString = getPreviewSize(
582+
previewDevice,
583+
maskWidthString,
584+
maskWidthStringTablet,
585+
maskWidthStringMobile
586+
);
572587
const previewMaskHeightString = getPreviewSize(
573588
previewDevice,
574589
maskHeightString,
@@ -594,6 +609,8 @@ export function Edit(props) {
594609
aspect-ratio: ${maskAspectRatioString};
595610
596611
height: ${previewMaskHeightString};
612+
width: ${previewMaskWidthString};
613+
max-width: 100%;
597614
}
598615
`;
599616
}

0 commit comments

Comments
 (0)