Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

bug(tooltip): $apply already in progress #516

@blabno

Description

@blabno

Tooltip throws exceptions if bound to button and ngClick takes long.
HTML:

<button ng-click="exitEdit()" tooltip="Exit edit mode">exit</button>

JavaScript:

    $scope.exitEdit = function ()
    {
        if (this.isModified()) {
            if (!window.confirm("There are changes. Do you want to quit without saving?")) {
                return false;
            }
            ...
    }

The window.confirm pauses execution, which happens in $apply phase so the tooltip hits the same phase as it's triggered by jQuery (outside of Angular):

Error: $apply already in progress
beginPhase@http://localhost:8000/libs/angular.js:8288
Scope.$apply@http://localhost:8000/libs/angular.js:8090
hideTooltipBind@http://localhost:8000/libs/angular-ui-bootstrap.js:3451
jQuery.event.special[orig].handle@http://localhost:8000/libs/jquery.js:3431
jQuery.event.dispatch@http://localhost:8000/libs/jquery.js:3074
jQuery.event.add/elemData.handle@http://localhost:8000/libs/jquery.js:2750
(?)() angular.js (line 5704)
anonymous() angular.js (line 4800)
$apply(expr=undefined) angular.js (line 8093)
hideTooltipBind () angula...trap.js (line 3451)
handle(event=Object { originalEvent=Event mouseout, type="mouseout", timeStamp=0, more...}) jquery.js (line 3431)
dispatch(event=Object { originalEvent=Event mouseout, type="mouseout", timeStamp=0, more...}) jquery.js (line 3074)
handle(e=mouseout clientX=1132, clientY=104) jquery.js (line 2750)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions