Planned
Last Updated: 18 Jun 2021 12:03 by ADMIN
Scheduled for 2.26.0
Pablo
Created on: 19 May 2021 12:11
Category: Tooltip
Type: Bug Report
5
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.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Vaughan
Posted on: 25 May 2021 05:57
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.

Regards,
Dimo
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.