Button component ignores "title" property

2 Answers 262 Views
Button
Jeff
Top achievements
Rank 1
Iron
Iron
Jeff asked on 02 Feb 2022, 04:50 PM

[kendo-react-buttons v5.0.1]

It seems that the `Button` component removes the `title` prop, making it empty string when rendered. This prevents Tooltip from working on a Button. Is this intentional?


<Button title="test">Test</Button>

renders

<button title="" class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-rounded-md"><span class="k-button-text">Test</span></button>

note that title is `title=""`

Full StackBlitz example: https://stackblitz.com/edit/react-2xvipj?file=app/main.jsx

 

2 Answers, 1 is accepted

Sort by
1
Accepted
Stefan
Telerik team
answered on 03 Feb 2022, 05:41 AM

Hello,

Thank you for the example.

That can be achieved using the parentTitle prop of the Tooltip. We need that property because now to button rendered a span with the text:

https://www.telerik.com/kendo-react-ui/components/tooltip/api/TooltipProps/#toc-parenttitle

That is an updated example:

https://stackblitz.com/edit/react-2xvipj-spjhmj?file=app/main.jsx

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Jeff
Top achievements
Rank 1
Iron
Iron
commented on 03 Feb 2022, 12:16 PM

That works. Thank you Stefan, I appreciate the help.
0
Jeff
Top achievements
Rank 1
Iron
Iron
answered on 02 Feb 2022, 05:32 PM

OK it turns out this is a side-effect of my stackblitz example being wrapped in a `<Tooltip>`. I guess Tooltip must strip the titles off any of it's children to prevent the default browser tooltip?

So I guess the bigger issue is that Tooltips don't work on Buttons... I'll make a new question for that.

Tags
Button
Asked by
Jeff
Top achievements
Rank 1
Iron
Iron
Answers by
Stefan
Telerik team
Jeff
Top achievements
Rank 1
Iron
Iron
Share this question
or