This fixes the issue where codemirror field data would not get saved on new/draft entries in Craft 3.2+. The issue stems from how Craft now handles draft forms. It generates an entirely new form and submits that, which breaks codemirror's internal submit handler. That handler is supposed to copy the data out to the original textarea, but it never fires.
The fix works around this by listening to codemirror's change event and copying data out as it is entered.
This fixes the issue where codemirror field data would not get saved on new/draft entries in Craft 3.2+. The issue stems from how Craft now handles draft forms. It generates an entirely new form and submits that, which breaks codemirror's internal submit handler. That handler is supposed to copy the data out to the original textarea, but it never fires.
The fix works around this by listening to codemirror's
change
event and copying data out as it is entered.Thanks.