mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore(textarea): move helper text below input
This commit is contained in:
parent
c21608c4aa
commit
b61be53f09
2 changed files with 8 additions and 7 deletions
|
@ -13,6 +13,7 @@ export const Default = () => ({
|
|||
hideLabel: boolean("No label (hideLabel)", false),
|
||||
labelText: text("Label text (labelText)", "Text Area label"),
|
||||
invalid: boolean("Show form validation UI (invalid)", false),
|
||||
helperText: text("Helper text (helperText)", "Optional helper text here"),
|
||||
invalidText: text(
|
||||
"Content of form validation UI (invalidText)",
|
||||
"A valid value is required"
|
||||
|
|
|
@ -103,13 +103,6 @@
|
|||
{labelText}
|
||||
</label>
|
||||
{/if}
|
||||
{#if helperText}
|
||||
<div
|
||||
class:bx--form__helper-text="{true}"
|
||||
class:bx--form__helper-text--disabled="{disabled}">
|
||||
{helperText}
|
||||
</div>
|
||||
{/if}
|
||||
<div
|
||||
class:bx--text-area__wrapper="{true}"
|
||||
data-invalid="{invalid || undefined}">
|
||||
|
@ -139,6 +132,13 @@
|
|||
on:focus
|
||||
on:blur></textarea>
|
||||
</div>
|
||||
{#if !invalid && helperText}
|
||||
<div
|
||||
class:bx--form__helper-text="{true}"
|
||||
class:bx--form__helper-text--disabled="{disabled}">
|
||||
{helperText}
|
||||
</div>
|
||||
{/if}
|
||||
{#if invalid}
|
||||
<div id="{errorId}" class:bx--form-requirement="{true}">{invalidText}</div>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue