mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
Merge pull request #5745 from ueberdosis/update-editable-on-re-render
fix(react): preserve editable option across renders
This commit is contained in:
commit
4cb6f98946
5
.changeset/loud-maps-work.md
Normal file
5
.changeset/loud-maps-work.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/react": patch
|
||||
---
|
||||
|
||||
preserve editable option across re-renders #5547
|
@ -199,7 +199,10 @@ class EditorInstanceManager {
|
||||
if (this.editor && !this.editor.isDestroyed && deps.length === 0) {
|
||||
// if the editor does exist & deps are empty, we don't need to re-initialize the editor
|
||||
// we can fast-path to update the editor options on the existing instance
|
||||
this.editor.setOptions(this.options.current)
|
||||
this.editor.setOptions({
|
||||
...this.options.current,
|
||||
editable: this.editor.isEditable,
|
||||
})
|
||||
} else {
|
||||
// When the editor:
|
||||
// - does not yet exist
|
||||
|
Loading…
Reference in New Issue
Block a user