Fix Chrome issue with sizes="0px" (#7886)

"Do not dumb here. Not dumb area here."
th-downstream
Eugen Rochko 6 years ago committed by GitHub
parent ef3ac6e4a7
commit 2dfd016085

@ -122,7 +122,7 @@ class Item extends React.PureComponent {
const hasSize = typeof originalWidth === 'number' && typeof previewWidth === 'number';
const srcSet = hasSize ? `${originalUrl} ${originalWidth}w, ${previewUrl} ${previewWidth}w` : null;
const sizes = hasSize ? `${displayWidth * (width / 100)}px` : null;
const sizes = hasSize && (displayWidth > 0) ? `${displayWidth * (width / 100)}px` : null;
const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0;
const focusY = attachment.getIn(['meta', 'focus', 'y']) || 0;

Loading…
Cancel
Save