Add ComponentBase.setEnabled method
This commit is contained in:
parent
5b15d1d35d
commit
cfd976738e
1 changed files with 10 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue