Error 'this.tip.parentNode is null' when disposing of Tooltip.
Created by: nikonthethird
Bootstrap V5 Alpha 1.
I get an error at this source code line:
System.Exception: Microsoft.JSInterop.JSException: this.tip.parentNode is null
dispose@https://localhost:5001/vendor/js/bootstrap.bundle.js:6130:9
window.blazor_disableTooltip@https://localhost:5001/app.js:17:52
beginInvokeJSFromDotNet/i<@https://localhost:5001/_framework/blazor.webassembly.js:1:3942
Context: I am developing a Blazor application that uses Bootstrap 5. When a Blazor component is destroyed, I clean up all the Bootstrap elements I have created, including tooltips. The error above does not appear all the time, but I can get it somewhat consistently when stopping the application.
I made the error disappear (I don't know if it's actually the right way to do this), by also checking if parentNode
is not null right here:
if (this.tip && this.tip.parentNode) {
this.tip.parentNode.removeChild(this.tip);
}
Operating System: Ubuntu 20.04 & Windows 10 2004 Browser: Chromium (latest) and Firefox (latest)