fix(form): asterisks on Label.astro (#160)
This commit is contained in:
parent
4b3e4c9f50
commit
5677222258
1 changed files with 22 additions and 19 deletions
|
@ -16,8 +16,7 @@ const isRequired: boolean = showValidationHints && validators.includes('validato
|
|||
|
||||
{
|
||||
control.label && control.labelPosition === 'left' && (
|
||||
<label for={control.name}>
|
||||
{isRequired && <span>*</span>}
|
||||
<label for={control.name} data-validation-required={isRequired ? "true" : null}>
|
||||
{control.label}
|
||||
</label>
|
||||
)
|
||||
|
@ -27,10 +26,14 @@ const isRequired: boolean = showValidationHints && validators.includes('validato
|
|||
|
||||
{
|
||||
control.label && control.labelPosition === 'right' && (
|
||||
<label for={control.name}>
|
||||
{isRequired && <span>*</span>}
|
||||
<label for={control.name} data-validation-required={isRequired ? "true" : null}>
|
||||
{control.label}
|
||||
</label>
|
||||
)
|
||||
}
|
||||
|
||||
<style>
|
||||
label[data-validation-required="true"]::before {
|
||||
content: "*";
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue