mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
fix(task-item): prevent onBlur being trigged when toggled (#5520)
This commit is contained in:
parent
97ea55fe4c
commit
dbcdaad30a
5
.changeset/slow-lies-promise.md
Normal file
5
.changeset/slow-lies-promise.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/extension-task-item": patch
|
||||
---
|
||||
|
||||
Prevent `onBlur` from being trigged when a task item is toggled
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user