Closed BoPeng closed 3 years ago
Hi Bo,
This sounds like a library conflict, where both easymde and htmx are fighting over the submit action.
Does easymde fire any events after it has updated the text area that you can catch with an hx-trigger
? That might be a good solution.
I have a form with a
textarea
that is edited byeasymde.js
. The idea is that thetextarea
is hidden and replaced by a bunch of codemirror stuff,The trick here is that the content of the
textarea
will be replaced by the content of the editor when thesubmit
event of theform
is triggered.However, when the form is triggered by
hx-post
, theform
element no longer emits asubmit
event (at least according to myaddEventListener
test code) so thetextarea
will always be empty when the form is submitted.I think this should be fixed if confirmed.