@ribajs/core
Version:
Core module of Riba.js
15 lines (13 loc) • 358 B
text/typescript
import { Binder } from "../binder.js";
/**
* Disables the element when value is true (negated version of `enabled` binder).
*/
export class DisabledBinder extends Binder<
boolean,
HTMLButtonElement | HTMLInputElement
> {
static key = "disabled";
routine(el: HTMLButtonElement | HTMLInputElement, value: boolean) {
el.disabled = !!value;
}
}