-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Tooltip fails when closing on an element that's removed #3347
Comments
plunkr please |
Closing this issue as potentially old, and due to lack of reproduction. Feel free to open a new issue if you are able to reproduce this on Plunker. |
I can reproduce this with a plunkr! http://plnkr.co/edit/gXcpxofs6PMJ1M7LaCfy?p=preview my fix is just "if (!ttScope) return;" as first line of hide() function |
That's a reasonable & simple fix - would you like to file a PR with it? If not, I can do so, but you should get the credit :) . |
We're actually hitting this error in several other locations in our application:
It seems for our issue, problem that ttScope is set to null here:
but the attrs.$observe() calls are not released. It seems those are still firing after $destroy happens in my tests. For each attrs.$observe(), it should hold on to the return value and then call it during release, correct? |
Good call - we need to investigate this further. |
- Do nothing on hide when `$scope` is already removed Closes angular-ui#4346 Fixes angular-ui#3347
- Do nothing on hide when `$scope` is already removed Closes angular-ui#4346 Fixes angular-ui#3347
This is a rollup commit intended to address several issues around the positioning and parsing of attributes. - Fixes issue introduced under PR angular-ui#4311 where setting height and width in tooltip position function messed up arrow placement. - Fixes issue introduced under PR angular-ui#4363 where setting visibility to hidden in tooltip position function caused elements in popover to lose focus. - Fixes issue angular-ui#1780 where tooltip would render if content was just whitespace. - Fixes issue angular-ui#3347 where tooltip isolate scope was being accessed after it was set to null. Observers will now be created/destroyed as tooltip opens/closes which will also offer a performance improvement. - Fixes issue angular-ui#3557 by implementing evalAsync to set tooltip scope isOpen property. - Fixes issue angular-ui#4335 where if model isOpen property is undefined, tooltip would call show/hide toggle function. - Closes PR angular-ui#4429 where how the templated content was being evaluated could cause an infinite digest loop. Closes angular-ui#4400 Closes angular-ui#4418 Closes angular-ui#4429 Closes angular-ui#4431 Closes angular-ui#4455 Fixes angular-ui#1780 Fixes angular-ui#3347 Fixes angular-ui#3557 Fixes angular-ui#4321 Fixes angular-ui#4335
- Do nothing on hide when `$scope` is already removed Closes angular-ui#4346 Fixes angular-ui#3347
This is a rollup commit intended to address several issues around the positioning and parsing of attributes. - Fixes issue introduced under PR angular-ui#4311 where setting height and width in tooltip position function messed up arrow placement. - Fixes issue introduced under PR angular-ui#4363 where setting visibility to hidden in tooltip position function caused elements in popover to lose focus. - Fixes issue angular-ui#1780 where tooltip would render if content was just whitespace. - Fixes issue angular-ui#3347 where tooltip isolate scope was being accessed after it was set to null. Observers will now be created/destroyed as tooltip opens/closes which will also offer a performance improvement. - Fixes issue angular-ui#3557 by implementing evalAsync to set tooltip scope isOpen property. - Fixes issue angular-ui#4335 where if model isOpen property is undefined, tooltip would call show/hide toggle function. - Closes PR angular-ui#4429 where how the templated content was being evaluated could cause an infinite digest loop. Closes angular-ui#4400 Closes angular-ui#4418 Closes angular-ui#4429 Closes angular-ui#4431 Closes angular-ui#4455 Fixes angular-ui#1780 Fixes angular-ui#3347 Fixes angular-ui#3557 Fixes angular-ui#4321 Fixes angular-ui#4335
I'm using the tooltip on a delete button, which delete a row in a table. The button has a mouse enter/leave effect. When I click the button, which is then deleted with an animation, the following error is logged:
Uncaught TypeError: Cannot read property 'isOpen' of null
The following seems to fix the problem:
function toggleTooltipBind () {
if (!ttScope) return; // Check that the element still exists.
if ( ! ttScope.isOpen ) {
showTooltipBind();
} else {
hideTooltipBind();
}
}
The text was updated successfully, but these errors were encountered: