Mention Extension Not Rendering Suggestions When Editor Markup Changes #5611
-
Hello, Thank you for this awesome editor. I use it with the When I need to render an editor instance in various ways (e.g., one as a read-only variant and another in an editing state), the I have provided a link to a CodeSandbox example where I simulate the different markup by switching the https://codesandbox.io/p/sandbox/l6kw7y The expected behavior is that the suggestion list should render even when the mode is switched. I would appreciate any help 🙏 Thank you. Ondrej |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The same issue here - @zdychacek did you manage to find a solution? |
Beta Was this translation helpful? Give feedback.
The
useEditor
hook takes a dependency array to watch for changes. In your case, you can add theisEditable
in the dependency array to resolve the issue Updated sandbox.Although I would suggest an alternative approach. For enabling and disabling the editor instance provides a method called
setEditable
which takes a boolean as an argument.For reference - https://tiptap.dev/docs/editor/api/editor#seteditable