Add ComponentBase.setEnabled method

This commit is contained in:
Jordan Irwin 2024-05-26 12:45:05 -07:00
parent 5b15d1d35d
commit cfd976738e
No known key found for this signature in database
GPG key ID: E3E358C2F44C290A

View file

@ -57,4 +57,14 @@ export abstract class ComponentBase {
hasFocus(): boolean {
return document.activeElement == this.componentElement;
}
/**
* Enables or disables the HTML element.
*
* @param {boolean} enabled
* Enabled state to be set.
*/
setEnabled(enabled: boolean) {
(this.componentElement as any).disabled = !enabled;
}
}