Contributes to [TextInput] helperText enhancements #1633

This commit is contained in:
Samuel Janda 2024-01-14 16:37:33 +11:00
commit 00338eb6df

View file

@ -168,13 +168,15 @@
</div> </div>
{/if} {/if}
{/if} {/if}
{#if !isFluid && helperText} {#if !isFluid && (helperText || $$slots.helperText)}
<div <div
class:bx--form__helper-text="{true}" class:bx--form__helper-text="{true}"
class:bx--form__helper-text--disabled="{disabled}" class:bx--form__helper-text--disabled="{disabled}"
class:bx--form__helper-text--inline="{inline}" class:bx--form__helper-text--inline="{inline}"
> >
<slot name="helperText">
{helperText} {helperText}
</slot>
</div> </div>
{/if} {/if}
</div> </div>
@ -285,14 +287,16 @@
<div class:bx--form-requirement="{true}" id="{warnId}">{warnText}</div> <div class:bx--form-requirement="{true}" id="{warnId}">{warnText}</div>
{/if} {/if}
</div> </div>
{#if !invalid && !warn && !isFluid && !inline && helperText} {#if !invalid && !warn && !isFluid && !inline && (helperText || $$slots.helperText)}
<div <div
id="{helperId}" id="{helperId}"
class:bx--form__helper-text="{true}" class:bx--form__helper-text="{true}"
class:bx--form__helper-text--disabled="{disabled}" class:bx--form__helper-text--disabled="{disabled}"
class:bx--form__helper-text--inline="{inline}" class:bx--form__helper-text--inline="{inline}"
> >
<slot name="helperText">
{helperText} {helperText}
</slot>
</div> </div>
{/if} {/if}
{#if !isFluid && invalid} {#if !isFluid && invalid}