Open felixkiss opened 8 years ago
@felixkiss, did you ever figure this out?
@dirkdirk Right now, you have to do this manually. We do it like so:
// Clear trix-editor content
const trixEditor = document.querySelector('.description trix-editor');
if (trixEditor) {
trixEditor.editor.loadHTML(this.get('model.description'));
}
@felixkiss, thanks for the quick reply.
I actually switched to Simditor and had a similar problem but was able to solve it. Perhaps my answer there will help y'all.
I use
{{trix-editor}}
like so:When I type something in (e.g. "Foo Bar"), the
model.description
is set indescriptionChanged
.Now if a new model comes along (initially with an empty description), the trix-editor will still show whatever the user typed in for the old model's description (because value only populates on initial rendering of trix-editor).
How can I clear/set the content of the trix-editor?