-
Notifications
You must be signed in to change notification settings - Fork 6.7k
bug(tooltip): $apply already in progress #516
Comments
@blabno Could you please provide a plunker with a minimal reproduce scenario? I'm not sure how you are getting into this error scenario. Anyway, we need a reproduce scenario to progress. |
http://plnkr.co/edit/H1LgxDHSFeHsPiW0rgvz?p=preview btw. this error happens on firefox. On chrome you will not see it. |
Indeed, can see this in FFox only. But this one is really strange... No idea what is going on here, looks like a hide trigger is firing when a confirmation dialog gets opened... |
I stumbled across the same issue today when I tried to use the When This is reproducible both in chrome and firefox. Let me know if you need a PR. |
@sudhakar What you are doing in your plunker doesn't make much sense as you are using a AngularJS-powered click-event handler to trigger another event. In this case the What is your real use case? If this is for controlling tooltips / popovers pragmatically this should be solved properly in those directives. Using custom triggers to open / close tooltips is a pure hack... |
@pkozlowski-opensource Makes perfect sense & I have started refactoring the directive to handle it. Basically I am in the process of building a directive for providing "App tour" kind of functionality similar to http://usablica.github.io/intro.js/ and http://ryanfunduk.com/jquery-tourbus/. I started with using $tooltip provider & had a service to trigger popovers in sequence. In the end realised that it too hacky & have started using $position provider directly. Thanks again for making BS modular !! |
It looks like this is caused because Firefox fires a mouseout event when the confirm dialog is shown. This happens when the JS thread is waiting for confirm dialog to return and as such it attempts to run the $apply when $apply is already running. I'm not sure if we can get around this through using $evalAsync instead of $apply. |
This also happens in Chrome if there are two popups in a row: |
I ran into this issue on IE11 (11.0.9600.16428), but was able to monkey patch my way around it with:
|
Another scenario: If i use tooltip with "tooltip-trigger=focus" and ui-datepicker, same error occurs:
|
@gufigueiredo , that might be a possible use case to support after we release 0.13 . I've opened another issue for that (#3557). |
Tooltip throws exceptions if bound to button and ngClick takes long.
HTML:
JavaScript:
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):
The text was updated successfully, but these errors were encountered: