Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/list",
"version": "2.0.8",
"version": "2.0.9",
"keywords": [
"codex editor",
"list",
Expand Down
11 changes: 11 additions & 0 deletions src/ListRenderer/ChecklistRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ interface ChecklistCssClasses extends ListCssClasses {
* CSS class of the checkbox container
*/
checkboxContainer: string;

/**
* CSS class for disabled checkbox check
*/
checkboxCheckDisabled: string;
}

/**
Expand Down Expand Up @@ -61,6 +66,7 @@ export class CheckListRenderer implements ListRendererInterface<ChecklistItemMet
noHover: `${CssPrefix}__checkbox--no-hover`,
checkbox: `${CssPrefix}__checkbox-check`,
checkboxContainer: `${CssPrefix}__checkbox`,
checkboxCheckDisabled: `${CssPrefix}__checkbox-check--disabled`,
};
}

Expand Down Expand Up @@ -129,6 +135,11 @@ export class CheckListRenderer implements ListRendererInterface<ChecklistItemMet
checkboxContainer.classList.add(CheckListRenderer.CSS.itemChecked);
}

// Disable checkbox interaction in read-only mode
if (this.readOnly) {
checkboxContainer.classList.add(CheckListRenderer.CSS.checkboxCheckDisabled);
}

checkbox.innerHTML = IconCheck;
checkboxContainer.appendChild(checkbox);

Expand Down
4 changes: 4 additions & 0 deletions src/styles/list.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
transform: scale(1);
transition: transform 400ms ease-out, opacity 400ms;
}

&--disabled {
pointer-events: none;
}
}
}
}