Open krsaulitis opened 3 months ago
Hey there, it looks like there is some sort of recursion in this code which is causing the issue:
onUpdate()
sets this.state
to editor.getJSON()
:
https://github.com/awcodes/filament-tiptap-editor/blob/2fac9246f452a7c32bca8991587de895f28d3db8/resources/js/plugin.js#L364-L367state
for changes:
https://github.com/awcodes/filament-tiptap-editor/blob/2fac9246f452a7c32bca8991587de895f28d3db8/resources/js/plugin.js#L325-L332updateEditorContent()
with current state:
https://github.com/awcodes/filament-tiptap-editor/blob/2fac9246f452a7c32bca8991587de895f28d3db8/resources/js/plugin.js#L404-L410I'm not really sure what the intent of updateEditorContent()
is since it is called several times in various contexts, but if you comment editor.commands.setContent(content, true)
the redo button works.
hmm. Thanks for digging into the issue.
updateEditorContent
is used to update the editor from outside of it, ie, through a livewire event or similar.
You may be right about the recursion though.
I'll have to give it some thought.
Filament Version
v3.2.95
Plugin Version
v3.4.5
PHP Version
PHP 8.3.8
Problem description
The "redo" button or shortcut is not working in editor, nothing happens.
https://github.com/user-attachments/assets/87163785-d154-4b8d-8455-caa478322f9e
Expected behavior
The "redo" button reverts the changes after pressing undo.
Steps to reproduce
Reproduction repository
No response
Relevant log output
No response