Skip to content

Commit

Permalink
fix(task-item): prevent onBlur being trigged when toggled (#5520)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarlef authored Aug 20, 2024
1 parent 97ea55f commit dbcdaad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/slow-lies-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/extension-task-item": patch
---

Prevent `onBlur` from being trigged when a task item is toggled
1 change: 1 addition & 0 deletions packages/extension-task-item/src/task-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const TaskItem = Node.create<TaskItemOptions>({

checkboxWrapper.contentEditable = 'false'
checkbox.type = 'checkbox'
checkbox.addEventListener('mousedown', event => event.preventDefault())
checkbox.addEventListener('change', event => {
// if the editor isn’t editable and we don't have a handler for
// readonly checks we have to undo the latest change
Expand Down

0 comments on commit dbcdaad

Please sign in to comment.