Hide tooltip if there is no content provided

Hello, I've been trying to hide the tooltip in case no content is provided (if it's null, or undefined)


https://gist.github.com/Oxyrus/d38d2ea4d80b9f7a8c883e35cd773e39


However, with the previous approach, the content that should go inside is not even being displayed




On the top (where it says FL) there should be an icon with the tooltip, however it isn't even being displayed.


I have tried with simply


https://gist.github.com/Oxyrus/6fcdde03139306464d4f4390d03ffe92


But it's still showing a tooltip, with no content.




How can I avoid rendering the tooltip in case there is no content?


I'm using @syncfusion/ej2-angular-popups 18.2.58


1 Reply

SM Shalini Maragathavel Syncfusion Team July 5, 2021 11:38 AM UTC

Hi Andres, 

Based on your query we suspect that you need to hide the Tooltip when Tooltip content is empty. You can achieved this requirement by setting true value to the cancel property(cancels the request) of the Tooltip control’s beforeOpen event arguments as demonstrated in the below code example, 
 
export class AppComponent {  
  beforeOpen(args) { 
    if (this.tooltip.content == undefined || this.tooltip.content == null) { 
      args.cancel = true; 
    }
}

In the above sample we have changed the content of the Tooltip in an external textbox component.

Please refer the below sample for your reference, 

Please get back to us, if you need further assistance.

Regards, 
Shalini M. 



Loader.
Up arrow icon