Hi Brice,
Greetings from Syncfusion support.
We have looked into your reported problem with Tooltip component. We would like to let you know that Tooltip is independent component, and it would not dynamically detect if the content of the tooltip changes, dynamically.
This is the reason that when the validation message reset to empty, Tooltip’s popup alignment breaks in the UI. To resolve this issue, we need to validate whether the target texbox has valid input content, and need to call the Close() method of the tooltip in textbox’s Blur event.
|
<SfTooltip @ref="tooltipObj" OffsetX="tipx" OffsetY="tipy" OnOpen="open" OnClose="close" OpensOn="Focus" Target="#sham">
<SfTextBox @ref="textObj" ID="sham" Placeholder="Test Property" FloatLabelType='@FloatLabelType.Always' @bind-Value="model.TestProperty" CssClass="@cssClass" Blur="TestPropertyBlurEvent"></SfTextBox>
<TooltipTemplates>
<Content>
<ValidationMessage For="@(() => model.TestProperty)"></ValidationMessage>
</Content>
</TooltipTemplates>
</SfTooltip>
public void TestPropertyBlurEvent(FocusOutEventArgs args)
{
if (!editContext.Validate())
{
this.tooltipObj.Open();
}
else
{
this.tooltipObj.Close();
}
} |
Also, since you are using textbox for validation we suggest you to Focus as value for opensOn property of Tooltip. Since, tooltip will disappear when focus out the taget textbox, everytime. So, we can keep it open by calling Open() method, only when validation fails.
Please, let us know if you need any further assistance.
Regards,
Shameer Ali Baig S.