Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery block not "Cropping" images not working on Internet Explorer and Edge 15 #17775

Closed
mlaetitia opened this issue Oct 4, 2019 · 4 comments
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Browser Issues Issues or PRs that are related to browser specific problems [Type] Bug An existing feature does not function as intended

Comments

@mlaetitia
Copy link

mlaetitia commented Oct 4, 2019

Describe the bug

When setting up a Gallery block and choosing the option Crop Image :

see screen shot https://cld.wthms.co/gp8Uhm

on Internet Explorer 11 or Edge 15 the images don't get cropped - on the editor, preview or live site.

To reproduce
Steps to reproduce the behavior:

  1. Go to Post or Page -> Add New Gallery block and choose two / three pics having at least one in portrait and one landscape
  2. Choose the option "Crop Images"
  3. From the editor, you can see the images aren't cropped / the same size.

Expected behavior
As with other browsers the images should be the same size in the gallery

Screenshots
In IE 11: https://cld.wthms.co/pDI7Pu
In Firefox: https://cld.wthms.co/hI3RbE

Desktop (please complete the following information):
Tested on Browser Stack, plus on a Windows 7 + IE11 computer

@swissspidy swissspidy added the [Block] Gallery Affects the Gallery Block - used to display groups of images label Oct 11, 2019
@bunglegrind
Copy link

...because of object-fit: cover not supported by IE11 and EDGE < 16.

@bunglegrind
Copy link

bunglegrind commented Nov 12, 2019

a workaround:

.is-cropped .blocks-gallery-item img {
  width: auto !important;
  height: 230px !important;
  max-width: 1000% !important;
  position: relative;
  top: 50%;
  left: 50%;
  -webkit-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
}

.is-cropped .blocks-gallery-item figure {
  overflow: hidden;
}

@supports ((-o-object-fit: cover) or (object-fit: cover)) {
  .is-cropped .blocks-gallery-item img {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    -o-object-fit: cover;
    object-fit: cover;
    height: 230px !important;
    width: 100% !important;
    max-width: 100% !important;
    position: unset !important;
    top: unset !important;
    left: unset !important;
    -webkit-transform: unset !important;
    transform: unset !important;
  }

  .is-cropped .blocks-gallery-item figure {
    overflow: unset !important;
  }
}

@noisysocks noisysocks added Browser Issues Issues or PRs that are related to browser specific problems Needs Testing Needs further testing to be confirmed. labels Apr 23, 2020
@ajlende ajlende mentioned this issue Sep 9, 2020
10 tasks
@talldan talldan added [Type] Bug An existing feature does not function as intended and removed Needs Testing Needs further testing to be confirmed. labels Sep 29, 2020
@talldan
Copy link
Contributor

talldan commented Sep 29, 2020

Thanks for reporting this.

Despite it being mentioned that object-fit is now pollyfilled in IE11 (see #25171), this seems to still be a bug when I tested.

See the following screenshots for comparison:
IE11:
Screenshot 2020-09-29 at 1 30 01 pm

Firefox:
Screenshot 2020-09-29 at 1 30 10 pm

@youknowriad
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images Browser Issues Issues or PRs that are related to browser specific problems [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants