-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating list of tools after editor is initialized #2397
Comments
I'm faced with a similar dilemma. The
This makes JSON.stringifying the Am I completely missing something? If there was a way to configure tools post-construction, this might be easier, and would solve the issue raised in this thread, too. |
It could be implemented, but we need to understand why you prefer changing the tools list rather than just destroy/reinitialize the editor. |
I don't know about the others, but from my perspective, reinitialization does not work well UX-wise. Autofocus often reapplies, scroll resets, the editor's content flashes, and in some situations, the layout around the editor will "jump" due to editor size changes. All those things can be prevented somehow, but it's not a pleasant process to debug all those problems and apply fixes. |
same issue here. We are updating config of the custom tool depending on the outer state. Unfortunately it does not take any effect... |
Hi @neSpecc, any update on this? I tried a monkey patch in my personal project to add this functionality. Not sure if its right, but works fine. happy to create a PR with necessary tweaks if you like! |
Hi there,
I was wondering, what would be the preferred method of updating a list of tools once the editor is already active and visible for users? I saw that there is a setter for configuration that handles new config, but I am not sure how to make
EditorJS
object utilize that new info. Right now setting new value won't update the editor.My use case revolves around adding or removing toolbar items based on some external user config. I know that some blocks may not render after such a thing happens, but that is something I don't have a problem with as I know users won't mind losing a block when they disable some tool in their config.
Is destruction and reinitialization the only way to achieve this?
The text was updated successfully, but these errors were encountered: