Skip to content

Commit

Permalink
fix: fix Widget unmerged changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed Oct 25, 2023
1 parent 061af0a commit f2de68f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ abstract class Widget {
}

/**
* Determines if widget is read only (default is false)
* Determines if widget is read only (default is undefined)
*/
_readOnly: boolean;
get readOnly(): boolean {
_readOnly: boolean | undefined;
get readOnly(): boolean | undefined {
return this._readOnly;
}

set readOnly(value: boolean) {
set readOnly(value: boolean | undefined) {
this._readOnly = value;
}

Expand Down Expand Up @@ -106,20 +106,25 @@ abstract class Widget {

constructor(props?: any) {
this._colspan = Widget._defaultColspan;
this._readOnly = false;
this._invisible = false;

if (props) {
if (props.colspan) {
this._colspan = +props.colspan;
}
if (props.readonly) {
if (props.readonly !== undefined) {
if (
props.readonly === "1" ||
props.readonly === 1 ||
props.readonly === true
) {
this._readOnly = true;
} else if (
props.readonly === "0" ||
props.readonly === 0 ||
props.readonly === false
) {
this._readOnly = false;
}
}
if (props.invisible) {
Expand Down

0 comments on commit f2de68f

Please sign in to comment.