Skip to content

Commit

Permalink
Fixed Checkbox issue in Readonly mode (#213)
Browse files Browse the repository at this point in the history
Co-authored-by: Vishal <[email protected]>
  • Loading branch information
vishalshrm539 and Vishal authored Oct 23, 2024
1 parent 603d95b commit fad7c55
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/fields/Checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,14 @@ class CheckBox extends FormComponentBase {
// Handle and return if read only rendering
if (this.bReadonly && this.bVisible) {
return html`
<lion-checkbox .pConn=${this.thePConn} ?disabled=${this.bReadonly} label=${this.caption} value=${this.value} testId=${this.testId}>
<lion-checkbox
.pConn=${this.thePConn}
?disabled=${this.bReadonly}
label=${this.caption}
value=${this.value}
?checked=${this.isChecked}
testId=${this.testId}
>
</lion-checkbox>
`;
}
Expand All @@ -204,7 +211,7 @@ class CheckBox extends FormComponentBase {
const listOfCheckboxes: any = [];
const listSourceItems = this.theConfigProps.datasource?.source ?? [];
const dataField: any = this.theConfigProps.selectionKey?.split?.('.')[1];
const label = html`<div class="check-box-form">${bHideLabel ? nothing : this.label}}</div>`;
const label = html`<div class="check-box-form">${bHideLabel ? nothing : this.label}</div>`;
listOfCheckboxes.push(label);
listSourceItems.forEach((element, index) => {
const multiChecked = this.selectedvalues?.some?.(data => data[dataField] === element.key);
Expand Down

0 comments on commit fad7c55

Please sign in to comment.