Trix: How To Reset the trix editor content?

Created on 20 Nov 2016  路  2Comments  路  Source: basecamp/trix

How does one initialize the contents for a second time? For example I have a dialog with the trix editor in it. Each time I pop up the dialog, I want to be able to reinitialize the content in the editor.

Setting the value to the associated hidden input= field does not work. Seems to only work the 1st time.

Most helpful comment

If your <trix-editor> is inside a form you can reset the form. Otherwise you can do element.value = "", which is a shortcut for element.editor.loadHTML("").

All 2 comments

If your <trix-editor> is inside a form you can reset the form. Otherwise you can do element.value = "", which is a shortcut for element.editor.loadHTML("").

Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lcsqlpete picture lcsqlpete  路  3Comments

WhatFreshHellIsThis picture WhatFreshHellIsThis  路  4Comments

acapro picture acapro  路  3Comments

madikarizma picture madikarizma  路  5Comments

lanzhiheng picture lanzhiheng  路  4Comments