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

Fix for issue #520 where IE11 flashed up the modal after close #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glenatron
Copy link

Issue #520 is caused by an IE bug, which Microsoft do not intend to fix. This works around that by setting a manual timeout based on the animation duration configured for the modal element.

What issue is this PR resolving? Alternatively, please describe the bugfix/enhancement this PR aims to provide

Have you provided unit tests that either prove the bugfix or cover the enhancement?

Related issues

@@ -170,10 +170,22 @@
$rootScope.$broadcast('ngDialog.closing', $dialog, value);
dialogsCount = dialogsCount < 0 ? 0 : dialogsCount;
if (animationEndSupport && !options.disableAnimation) {
var isIE = !!window.MSInputMethodContext && !!document.documentMode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting needs to match existing code

// Awful IE detection due to https://connect.microsoft.com/IE/feedbackdetail/view/1605631/animation-end-events-firing-late
else {
$dialog.addClass('ngdialog-closing');
var duration = window.getComputedStyle($dialog.find(".ngdialog-content")[0]).animationDuration,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes only

@@ -170,10 +170,22 @@
$rootScope.$broadcast('ngDialog.closing', $dialog, value);
dialogsCount = dialogsCount < 0 ? 0 : dialogsCount;
if (animationEndSupport && !options.disableAnimation) {
var isIE = !!window.MSInputMethodContext && !!document.documentMode;
scope.$destroy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this scope destroy not be above the isIE declaration?

else {
$dialog.addClass('ngdialog-closing');
var duration = window.getComputedStyle($dialog.find(".ngdialog-content")[0]).animationDuration,
dialogAnimationDuration = (0 < duration.indexOf("ms")) ? parseFloat(duration) : parseFloat(duration) * 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes

@faceleg
Copy link
Contributor

faceleg commented Feb 13, 2017

I appreciate the work. I hate browser hacks. I understand this is the only way to fix this.

I understand this should fix the issue for our users and will merge when you've made the above changes.

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants