angular-notify icon indicating copy to clipboard operation
angular-notify copied to clipboard

notify div is not removed from DOM when transitionend event is not fired

Open chris-armstrong opened this issue 9 years ago • 3 comments

I've noticed an intermittent issue where

element housing the notification message is not always removed from the DOM after it is faded out (i.e. after the opacity is set to 0). This results in the transparent notification message obscuring part of the screen, preventing it from receiving mouse clicks or touch events.

The problem seems to be this code:

                var templateElement = $compile(template)(scope);
                templateElement.bind('webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd', function(e){
                    if (e.propertyName === 'opacity' || e.currentTarget.style.opacity === 0 || 
                        (e.originalEvent && e.originalEvent.propertyName === 'opacity')){

                        templateElement.remove();

transitionend event isn't always sent by the browser - an instance may be when the transition is interrupted by another process. This means that the element may not get removed where the event isn't fired.

chris-armstrong avatar Jan 06 '16 04:01 chris-armstrong

Please find attached a pull request #56 that fixes this issue.

You can replicate the issue by setting a breakpoint in $scope.close = function() {... and then manually closing the element and then stepping over the following line, which suppresses the transitionend event:

templateElement.css('opacity',0).attr('data-closing','true');

chris-armstrong avatar Jan 06 '16 04:01 chris-armstrong

The issue still persists. Will the corresponding PR be merged any time soon?

xReeQz avatar May 03 '17 11:05 xReeQz

This will be fixed some day?

KaduAmaral avatar Nov 21 '17 17:11 KaduAmaral