From a1655489ab5dd4e025b5a9b4be6c9722b85dd636 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni <6173598+dpschen@users.noreply.github.com> Date: Mon, 16 Jun 2025 22:43:54 +0200 Subject: [PATCH] fix(frontend): mark only clicked task item (#891) --- frontend/cypress/e2e/task/task.spec.ts | 37 +++++++++++++++++++ .../src/components/input/editor/TipTap.vue | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/e2e/task/task.spec.ts b/frontend/cypress/e2e/task/task.spec.ts index 2335b45d3..49abc9a2b 100644 --- a/frontend/cypress/e2e/task/task.spec.ts +++ b/frontend/cypress/e2e/task/task.spec.ts @@ -951,6 +951,43 @@ describe('Task', () => { .should('have.length', 5) cy.get('.task-view .checklist-summary') .should('contain.text', '2 of 5 tasks') + }) + + it('Persists checked checklist items after reload', () => { + const tasks = TaskFactory.create(1, { + id: 1, + description: ` +`, + }) + cy.visit(`/tasks/${tasks[0].id}`) + + cy.get('.task-view .checklist-summary') + .should('contain.text', '0 of 2 tasks') + cy.get('.tiptap__editor ul > li input[type=checkbox]') + .first() + .click() + + cy.get('.task-view .details.content.description h3 span.is-small.has-text-success') + .contains('Saved!') + .should('exist') + + cy.get('.task-view .checklist-summary') + .should('contain.text', '1 of 2 tasks') + + cy.reload() + + cy.get('.task-view .checklist-summary') + .should('contain.text', '1 of 2 tasks') + cy.get('.tiptap__editor ul > li input[type=checkbox]') + .first() + .should('be.checked') }) it('Should use the editor to render description', () => { diff --git a/frontend/src/components/input/editor/TipTap.vue b/frontend/src/components/input/editor/TipTap.vue index cabd2f31f..89f77d39a 100644 --- a/frontend/src/components/input/editor/TipTap.vue +++ b/frontend/src/components/input/editor/TipTap.vue @@ -452,7 +452,7 @@ const extensions : Extensions = [ // https://github.com/ueberdosis/tiptap/issues/3676 editor.value!.state.doc.descendants((subnode, pos) => { - if (node.eq(subnode)) { + if (subnode === node) { const {tr} = editor.value!.state tr.setNodeMarkup(pos, undefined, { ...node.attrs,