fixed validation bug

pull/385/head
Cory LaViska 2021-03-16 09:03:15 -04:00
rodzic 42f646eaaa
commit b05d1967d0
3 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -11,6 +11,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
- Added `sl-clear` event to `sl-select`
- Fixed a bug where dynamically changing menu items in `sl-select` would cause the display label to be blank [#374](https://github.com/shoelace-style/shoelace/discussions/374)
- Fixed the margin in `sl-menu-label` to align with menu items
- Fixed a bug where setting the `value` attribute or property on `sl-input` and `sl-textarea` would trigger validation too soon
## 2.0.0-beta.33

Wyświetl plik

@ -257,7 +257,8 @@ export default class SlInput extends LitElement {
@watch('value')
handleValueChange() {
this.invalid = !this.input.checkValidity();
// Wait for the update to complete before checking the input's validity
this.updateComplete.then(() => (this.invalid = !this.input.checkValidity()));
}
render() {

Wyświetl plik

@ -226,7 +226,8 @@ export default class SlTextarea extends LitElement {
@watch('value')
handleValueChange() {
this.invalid = !this.input.checkValidity();
// Wait for the update to complete before checking the input's validity
this.updateComplete.then(() => (this.invalid = !this.input.checkValidity()));
}
setTextareaHeight() {