Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: fix text direction not working in check lists

Abdullah Atta436e09c25570
diff --git a/packages/editor/src/extensions/check-list-item/check-list-item.ts b/packages/editor/src/extensions/check-list-item/check-list-item.ts
index ac7aed0a2..e7e277d58 100644
--- a/packages/editor/src/extensions/check-list-item/check-list-item.ts
+++ b/packages/editor/src/extensions/check-list-item/check-list-item.ts
@@ -103,8 +103,6 @@ export const CheckListItem = Node.create<CheckListItemOptions>({
addNodeView() {
return ({ node, getPos, editor }) => {
- const isNested = node.lastChild?.type.name === CheckList.name;
-
const li = document.createElement("li");
if (node.attrs.checked) li.classList.add("checked");
else li.classList.remove("checked");
diff --git a/packages/editor/src/extensions/text-direction/text-direction.ts b/packages/editor/src/extensions/text-direction/text-direction.ts
index 9547eb22b..bbc67a1eb 100644
--- a/packages/editor/src/extensions/text-direction/text-direction.ts
+++ b/packages/editor/src/extensions/text-direction/text-direction.ts
@@ -30,6 +30,7 @@ const TEXT_DIRECTION_TYPES = [
"orderedList",
"bulletList",
"outlineList",
+ "checkList",
"taskList",
"table",
"blockquote",
diff --git a/packages/editor/styles/styles.css b/packages/editor/styles/styles.css
index 1ebbd8d06..bd9bd05f1 100644
--- a/packages/editor/styles/styles.css
+++ b/packages/editor/styles/styles.css
@@ -646,6 +646,16 @@ p > *::selection {
transform: rotate(90deg);
}
+.simple-checklist[dir="rtl"] li::after {
+ left: unset;
+ right: -24px;
+}
+
+.simple-checklist[dir="rtl"] li.checked::before {
+ left: unset;
+ right: -22px;
+}
+
[dir="rtl"] .taskItemTools { right: unset; left: 0 }
/* Check list */