Skip to content

Commit

Permalink
fix: disable task-list checkbox in View mode
Browse files Browse the repository at this point in the history
Issue ueberdosis/tiptap#3676 means changes in View mode will not be saved
  • Loading branch information
Zyten committed Sep 14, 2023
1 parent 900ea3e commit 3d43ba9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wiki/public/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const editor = new Editor({
TaskItem.configure({
nested: true,
//Save state when task-item is updated in View mode
onReadOnlyChecked: () => true,
//TODO: Enable once ueberdosis/tiptap#3676 is fixed
//onReadOnlyChecked: () => true,
}),
],
inputRules: [disableMarkdownShortcut("#", "#")],
Expand Down Expand Up @@ -417,3 +418,11 @@ $(".edit-wiki-btn").on("click", () => {
editor.commands.setContent(getContent());
editor.commands.focus("start");
});

// TODO: Remove once ueberdosis/tiptap#3676 is fixed
$('ul[data-type=taskList] input[type=checkbox]').click(function(){
const urlParams = new URLSearchParams(window.location.search);

if(!urlParams.get("newWiki") && !urlParams.get("editWiki"))
return false;
});

0 comments on commit 3d43ba9

Please sign in to comment.