Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Lightbox not working on IE 11 #277

Open
samuelstein opened this issue Nov 1, 2017 · 25 comments
Open

Lightbox not working on IE 11 #277

samuelstein opened this issue Nov 1, 2017 · 25 comments
Labels

Comments

@samuelstein
Copy link

Hello,
the lightbox examples working only on chrome and firefox. in ie only the grey overlay is shown but not the actual content. the js console shows no error.
any ideas?

@ashleydw
Copy link
Owner

ashleydw commented Nov 1, 2017

Can you post a debug of the console, and a screenshot?

@samuelstein
Copy link
Author

yes.
lightbox-ie11

@ashleydw
Copy link
Owner

ashleydw commented Nov 2, 2017

I can confirm this happens, will investigate soon

@ashleydw ashleydw added bug and removed support labels Nov 2, 2017
@baggi97
Copy link

baggi97 commented Nov 10, 2017

It's due to the use of display: flex which isn't fully supported by IE

@prasanna03
Copy link

prasanna03 commented Nov 14, 2017

Is there any hacky solution to fix it temporarily (till this bug is fixed)

@gg-iccc
Copy link

gg-iccc commented Nov 15, 2017

Any news on this? I've been trying to come up with a work around without any luck.

@ashleydw
Copy link
Owner

This was introduced in #274, so just use 5.2.0 for now

@ashleydw ashleydw changed the title Lightbox examples not working on IE 11 Lightbox not working on IE 11 Nov 15, 2017
@kaburkett
Copy link

It's great that we weren't the first to find this issue.

Confirmed @ashleydw workaround by replacing our version with 5.2.0:

https://cdnjs.com/libraries/ekko-lightbox/5.2.0

@ashleydw
Copy link
Owner

@RafaPolit maybe you have a suggestion on fixing the IE flex bug?

@Linewalker
Copy link

Linewalker commented Feb 11, 2018

Change
this._$modalDialog.css('flex', '1').css('maxWidth', width);
to
this._$modalDialog.css('flex', '100%').css('maxWidth', width);

And you're done.

@efnack
Copy link

efnack commented Feb 24, 2018

Change the code as Linewalker said.
And to center it on Edge (I did not test it on older IE) add on the next line

if (/*@cc_on!@*/false || !!document.documentMode) this._$modalDialog.css('margin-left', '0').css('margin-right', '0');

@Domtaholic
Copy link

We need this fix - fast. We used this lightbox in production and are fuc*** right now.

Please do what you can, as fast as you can. I owe you a beer then ;)

@cseelus
Copy link

cseelus commented Mar 14, 2018

@Domtaholic Just add the following CSS, no big deal:

.ekko-lightbox .modal-dialog {
  flex: 100%!important;
  margin-left: 0;
  margin-right: 0;
}

Did the same a moment ago, as we have to use 5.3.0 and can confirm this works with IE11.

Thanks @ashleydw for the great work.

@kaburkett
Copy link

@Domtaholic no one here is your bitch... contribute if you want open sourced projects to add new features

@chasepeeler
Copy link

chasepeeler commented Jun 5, 2018

I fixed the issue with the following:

.ekko-lightbox {
  &.iefix {
    .modal-dialog {
      margin-left: calc(-1 * 50%);
    }
  }
}

Then, in my JS

img.ekkoLightbox({
onShown: function(){
  if(util.ieBrowserIE()){
    $('.ekko-lightbox').addClass('iefix');
   }
 }
});

Don't know if this solution is better or worse than those above, but figured I'd share.

@kanlukasz
Copy link

@cseelus solution is working. thanks!

@giedriusr
Copy link

giedriusr commented Jul 26, 2018

So what's the status? Is 5.3.0 the correct version to use or not?

@cseelus
Copy link

cseelus commented Jul 26, 2018

@giedriusr Yep, 5.3.0 works quite well

@giedriusr
Copy link

IE 11 as well?

@cseelus
Copy link

cseelus commented Jul 27, 2018

Jep, with my additional CSS from above.

@WestFR
Copy link

WestFR commented Jul 31, 2018

@cseelus solution is working ! Thanks you.

For more information, i have added this on my CSS :

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* IE10+ CSS */
    .ekko-lightbox .modal-dialog {
      flex: 100%!important;
      margin-left: 0;
      margin-right: 0;
      overflow: hidden;
      -ms-overflow-style: none;
    }
}

This code detects the presence of an IE type browser and apply the style.

In my use case, some images displayed in portrait mode display the vertical or horizontal scroll bar only on IE with this new style.

So, overflow: hidden; & -ms-overflow-style: none; disable the scroll on the element and not display the horizontal and vertical scroll bars !

Hoping that it can help you !

@ashleydw
Copy link
Owner

ashleydw commented Aug 8, 2018

Hopefully fixed in https://github.com/ashleydw/lightbox/releases/tag/v5.4.0-rc

I changed the flex from 1 to 100% as per the comments above

ashleydw added a commit that referenced this issue Aug 8, 2018
@KminekMatej
Copy link

KminekMatej commented Sep 7, 2018

Confirming fixed in RC5.4 - images are already displaying correctly in Edge.
There still presist an issue in IE, where images are displayed but not centered.

But, yeah, IE is such a dead horse that thats probably not worth even mentioning than fixing :-)
Thanks for the fix

EDIT: Now I realized this issue is called IE11 fix. Well, not fixed then - image is not centered

@ashleydw
Copy link
Owner

ashleydw commented Sep 7, 2018

👍 thanks @KminekMatej

Not centered vertically or horizontally? Vertically is expected as per Bootstrap modal.

A new option verticalAlignCenter will vertically center the modal.

@KminekMatej
Copy link

Like this, so horizontaly:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests