How do you handle autobinding in a text editor? How can I detect when the source has changed?
I released a rich text editor plugin (yes, yet another one in the marketplace. But mine is unique, I swear!).
Autobinding works when the source of the content doesn’t change. For example, if you have a page of type
article and you feed that article’s
body to the editor it will load the content properly.
On the other hand, if I place it on a popup and I change the data source constantly, editor misbehaves. Data won’t load or it will load multiple times or it will overwrite data. A mess.
I was so desperate that I even tried silly things like this:
// the editor is initialized let content = properties.autobinding; instance.data.editor.setContent(content);
But you can imagine the result: