Closed jakubwalawender closed 2 years ago
Hi Jakub Thanks for your pull-request. i like the addition. I have some remarks before I can merge it. Could you make the Tooltip a RenderFragment. And that can be set in the RenderFormElements component.
<EditForm Model="Model"
OnValidSubmit="HandleValidSubmit"
OnInvalidSubmit="HandleInValidSubmit">
<DataAnnotationsValidator></DataAnnotationsValidator>
<RenderFormElements>
<LabelDescriptionTemplate >
<Tooltip Text="@FormColumnDefinition.RenderOptions.Description">
<div>(<i class="oi oi-info small"></i>)</div>
</Tooltip>
</LabelDescriptionTemplate >
</RenderFormElements>
<button class="btn btn-primary" type="submit">Submit</button>
</EditForm>
You can set the implementation for the Components.Plain version below. This is framework agnostic.
if(LabelDescriptionTemplate ==null){
<Tooltip Text="@FormColumnDefinition.RenderOptions.Description">
<div>ℹ</div>
</Tooltip>
} else{
@RenderLabelDescriptionTemplate()
}
Than you should set your implementation as a default in the Components.Bootstrap:
if(LabelDescriptionTemplate ==null){
<Tooltip Text="@FormColumnDefinition.RenderOptions.Description">
<div>(<i class="oi oi-info small"></i>)</div>
</Tooltip>>
} else{
@RenderLabelDescriptionTemplate()
}
And could you please update the Readme.md with an example of the description below the Layout paragraph.
Sorry for the delay, but hadn't the time to review your code.
Kind regards, Alex
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Added a tooltip component which appears by the label when Description property in Display attribute is set. After hovering an icon it displays a text from Description.
A Description for a property:
A Description for a whole row (works with either TOP or LEFT alignment):