Hi, I am using Blazor Metronic Templates. Tooltips doesn't work in components because components add content dynamically to dom.
Kindly guide me how can I resolve this problem to show tooltips in Blazor Components
To make tooltips work in Blazor components using Metronic templates, you need to initialize them manually after the content is dynamically added to the DOM. Since Blazor renders components dynamically, the tooltips may not be automatically recognized. You can resolve this by calling Bootstrap.Tooltip via JavaScript after the component has rendered. Use JSRuntime.InvokeVoidAsync("eval", "new bootstrap.Tooltip(document.body, { selector: '[data-bs-toggle=\"tooltip\"]' })"); inside OnAfterRenderAsync. This ensures tooltips get initialized properly. If you need more insights on Blazor development, Weboutride Games also provides useful guides and resources.
Hi,
You just need to call the global component initializer API function whenever you add a component dynamically:
KTComponents.init()