working on tests

This commit is contained in:
konnorrogers
2024-05-07 23:00:03 -04:00
parent 1174200f20
commit 34bba3db19

View File

@@ -231,6 +231,22 @@ export default class WaRange extends WebAwesomeFormAssociated {
}
}
formStateRestoreCallback(...args: Parameters<WebAwesomeFormAssociated['formStateRestoreCallback']>) {
const [value, reason] = args;
super.formStateRestoreCallback(value, reason);
/** @ts-expect-error Type widening issue due to what a formStateRestoreCallback can accept. */
this.input.value = value;
}
formResetCallback() {
// @ts-expect-error We pass a Number, but it wants a string :shrug:
this.input.value = this.defaultValue;
this.value = this.defaultValue;
super.formResetCallback();
}
render() {
const hasLabelSlot = this.hasSlotController.test('label');
const hasHelpTextSlot = this.hasSlotController.test('help-text');