kopia lustrzana https://github.com/shoelace-style/shoelace
fix(sl-range): add value change handler (#572)
rodzic
72f2cbe9e8
commit
25aa8318d9
|
@ -138,6 +138,17 @@ export default class SlRange extends LitElement {
|
|||
emit(this, 'sl-blur');
|
||||
}
|
||||
|
||||
@watch('value', { waitUntilFirstUpdate: true })
|
||||
handleValueChange() {
|
||||
this.value = Number(this.value);
|
||||
|
||||
if (this.input) {
|
||||
this.invalid = !this.input.checkValidity();
|
||||
}
|
||||
|
||||
requestAnimationFrame(() => this.syncRange());
|
||||
}
|
||||
|
||||
@watch('disabled')
|
||||
handleDisabledChange() {
|
||||
// Disabled form controls are always valid, so we need to recheck validity when the state changes
|
||||
|
|
Ładowanie…
Reference in New Issue