I am integrating this editor into my Liveview app. I observed that the editor shows up nicely but only shortly while page being loaded/refreshed and just disappears right after that! Here is how I did it:
Within <head>
in main layout:
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jodit/3.1.39/jodit.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jodit/3.1.39/jodit.min.js"></script>
Hook in app.js
:
Hooks.RichTxtEditor = {
mounted() {
console.log('Start rich text editor on: ' + this.el.id)
const editor = new Jodit('#' + this.el.id)
}
}
Within the form:
<%= textarea f, :feedback,
phx_hook: "RichTxtEditor",
class: "form-control", rows: 5,
required: true, value: @feedback %>
The werid thing is, it is not about a particular editor, I tried with CKEdtior, Quill, and several others. I observed same behavior!
Could that be something with Liveview?
Thanks a lot!