I am using a scenario where the tooltip shows for each textbox based on its title property, but the tooltip is not showing the correct message probably because the kendo ui library is changing it.
When you click the Submit button, then the title of each textbox is being set based on whether the textbox has a missing value. After clicking Submit button, if you focus into any textbox you will see that its title is set to empty string. I am showing the latest values of the title of each textbox on load event and also on focus, mouseenter and blur of each textbox.
The code sampe is at https://dojo.telerik.com/CZauQXvf
I have two questions.
- How can the tooltip show the message based on the lastest title of the textbox? This is not happening. If you input a value into any textbox and click Submit then the title of that textbox is being set to empty, but the tooltip for that textbox still shows the old message.
- How can the tooltip be not shown when there is no content in it i.e. title value of the textbox is an empty string? Right now its showing an empty tooltip.
1. If you change the title property, you need to refresh the tooltip so that it picks up the new title.
2. You could try this approach from stackoverflow which creates a beforeShow pseudo-event. Alternatively, only create the tooltip when you set the title, and if you clear the title, destroy the tooltip.
I made it work by using refresh. The sample is at https://dojo.telerik.com/LJFviLDx
But there are minor issues like the browser tooltip showing when the kendo tooltip is showing. Perhaps, the title attribute should not be populated to prevent this.
The browser tooltip showing seems to be a result of a combination of the visibility being toggled, the refresh and setting the title. Normally, having a kendo tooltip does not allow the browser tooltip to be shown.
Here is an implementation that creates and destroys the tooltip as necessary and seems to provide what you're looking for.