Tooltip runs update after dispose, triggering null reference error, repeating on scroll events.
Created by: clemdavies
Tooltip is running an update after being disposed of. After error occurs, reliable but not consistent across all tooltips, Tooltip continues to try to update and producing the same error when scrolling up and down page.
Only tested in Aurelia typescript environment. tooltip is a custom attribute basically setup like so:
attach(){
$(this.element).tooltip(options);
}
detached(){
$(this.element).tooltip("dispose");
}
"TypeError: Cannot read property 'template' of null\n at o.m.getTipElement (http://localhost:9000/scripts/vendor-bundle.js:50459:35772)\n at o.m._cleanTipClass (http://localhost:9000/scripts/vendor-bundle.js:50459:38934)\n at o.m._handlePopperPlacementChange (http://localhost:9000/scripts/vendor-bundle.js:50459:39075)\n at Object.onUpdate (http://localhost:9000/scripts/vendor-bundle.js:50459:34291)\n at Popper.update (http://localhost:9000/scripts/vendor-bundle.js:4678:18)\n at Popper.update$$1 (http://localhost:9000/scripts/vendor-bundle.js:6159:21)\n at http://localhost:9000/scripts/vendor-bundle.js:3838:7\n at <anonymous>\nFrom previous event:\n at http://localhost:9000/scripts/vendor-bundle.js:3836:30"
It is not happening on all tooltip instances, can have as many as 20 active at a time, but I can reliably replicate the error by navigating my site in a particular way. I have checked to ensure I am not creating the bug in my code. No duplicate references, duplicate instances, timing, etc.
I have traced it to bootstrap's tooltip.js code:
this.tip = this.tip || $(this.config.template)[0]
It looks like there is no check from
_handlePopperPlacementChange(data)
being called, through to trying to access template property on this.config.