Skip to content

Commit 70d3920

Browse files
committed
feat(TextArea): make outline red on maxlength
1 parent 44b52dc commit 70d3920

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/mdc/TextInput/TextArea.svelte

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ let element = {}
1818
let textarea = {}
1919
let height = ''
2020
21+
$: hasReachedMaxLength = maxlength && value.length >= maxlength
22+
2123
onMount(() => {
2224
resize()
2325
@@ -57,6 +59,7 @@ label {
5759
class:mdc-text-field--no-label={!label}
5860
class:mdc-text-field--label-floating={label}
5961
class:mdc-text-field--with-internal-counter={maxlength}
62+
class:mdc-text-field--invalid={hasReachedMaxLength}
6063
bind:this={element}
6164
>
6265
<textarea

0 commit comments

Comments
 (0)