Compare commits

...

5 Commits

Author SHA1 Message Date
konnorrogers
0c30a4ab9e fix textarea value being lost 2024-12-18 18:54:45 -05:00
konnorrogers
dd900a244f fix example 2024-12-18 18:54:18 -05:00
konnorrogers
008e4549db fix textarea 2024-12-18 18:53:24 -05:00
konnorrogers
84f203e8fd fix textarea value being lost 2024-12-18 18:43:29 -05:00
konnorrogers
f6e9bcf9fd fix host context selectors 2024-12-18 18:18:35 -05:00
5 changed files with 16 additions and 4 deletions

View File

@@ -63,6 +63,14 @@ Use the `disabled` attribute to disable a textarea.
<wa-textarea placeholder="Textarea" disabled></wa-textarea>
```
### Value
Use the `value` attribute to set an initial value.
```html {.example}
<wa-textarea value="Write something awesome!"></wa-textarea>
```
### Sizes
Use the `size` attribute to change a textarea's size.
@@ -89,4 +97,4 @@ Textareas will automatically resize to expand to fit their content when `resize`
```html {.example}
<wa-textarea resize="auto"></wa-textarea>
```
```

View File

@@ -25,7 +25,7 @@ describe('<wa-textarea>', () => {
expect(el.value).to.equal('');
expect(el.defaultValue).to.equal('');
expect(el.title).to.equal('');
expect(el.filled).to.be.false;
expect(el.appearance).to.equal('outlined');
expect(el.label).to.equal('');
expect(el.hint).to.equal('');
expect(el.placeholder).to.equal('');

View File

@@ -208,6 +208,7 @@ export default class WaTextarea extends WebAwesomeFormAssociatedElement {
}
private handleChange() {
this.valueHasChanged = true;
this.value = this.input.value;
this.setTextareaHeight();
this.dispatchEvent(new WaChangeEvent());
@@ -220,6 +221,7 @@ export default class WaTextarea extends WebAwesomeFormAssociatedElement {
}
private handleInput() {
this.valueHasChanged = true;
this.value = this.input.value;
this.dispatchEvent(new WaInputEvent());
}

View File

@@ -101,8 +101,9 @@
--wa-color-neutral-on-loud: white;
}
/** need to wrap :host-context() in an :is() selector for unsupported browsers */
.wa-theme-default-dark,
:host-context(.wa-theme-default-dark) {
:is(:host-context(.wa-theme-default-dark)) {
/**
* Foundational Colors
*/

View File

@@ -48,8 +48,9 @@
--wa-tooltip-line-height: var(--wa-line-height-normal);
}
/** need to wrap :host-context() in an :is() selector for unsupported browsers */
.wa-theme-default-dark,
:host-context(.wa-theme-default-dark) {
:is(:host-context(.wa-theme-default-dark)) {
/* Form controls */
--wa-form-control-background-color: var(--wa-color-surface-default);