Skip to content

Commit 286a605

Browse files
committed
fix(uui-textarea): add danger border if the element is invalid
1 parent ab01f1e commit 286a605

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/uui-textarea/lib/uui-textarea.element.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,19 @@ export class UUITextareaElement extends UUIFormControlMixin(LitElement, '') {
276276
:host {
277277
position: relative;
278278
}
279-
:host([error]) textarea {
280-
border: 1px solid var(--uui-color-danger) !important;
281-
}
279+
:host([error]) textarea,
282280
:host([error]) textarea[disabled] {
283281
border: 1px solid var(--uui-color-danger) !important;
284282
}
283+
:host(:not([pristine]):invalid) textarea,
284+
/* polyfill support */
285+
:host(:not([pristine])[internals-invalid]) textarea {
286+
border-color: var(--uui-color-danger);
287+
}
285288
:host([auto-height]) textarea {
286289
resize: none;
287290
}
291+
288292
.label {
289293
display: inline-block;
290294
margin-bottom: var(--uui-size-1);

0 commit comments

Comments
 (0)