ToolTip with no TargetSelector throws a JavaScript error
A ToolTip will trigger a JavaScript error in the following scenarios:
There is no TargetSelector.
The TargetSelector does not match any elements on the page.
The JS error is thrown on mouse click:
TypeError: undefined is not an object (evaluating 't.getAttribute')
3 comments
ADMIN
Marin Bratanov
Posted on:25 May 2021 06:11
Hi Vaughan,
Indeed, this is the second case that throws an error. You could avoid it by wrapping the tooltip component in an @if-block so it initializes only when those elements are also initialized, you should be able to reuse the same conditional logic.
The TargetSelector does not match any elements on the page is an issue for me too, as I have optional elements that need tooltips. I'm receiving this error when none of these elements happen to be rendered.
ADMIN
Dimo
Posted on:19 May 2021 12:18
Hello Pablo,
Thank you for bringing this issue to our attention. Normally, TargetSelector should be used, otherwise the ToolTip will be unusable. Nevertheless, we should not throw a JS error, so we will fix this.