mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
fix(sl-range): add value change handler (#572)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user