Fix that remote-auto-save loses markdown formatting by using local autosave

This commit is contained in:
Jason Zimdars
2025-02-26 17:48:02 -06:00
parent a0ffbc807f
commit ed08b85c25
+15 -3
View File
@@ -103,9 +103,21 @@
<% else %>
<div class="comments">
<div class="comment comment--new border-radius flex align-start full-width margin-block-double">
<form data-controller="remote-auto-save paste" data-remote-auto-save-auto-save-outlet="#bubble_form" class="flex flex-column gap full-width" data-action="paste->paste#pasteFiles">
<%= tag.house_md @bubble.draft_comment, name: "bubble[draft_comment]", class: "input comment__input", form: "bubble_form", placeholder: new_comment_placeholder(@bubble),
data: { action: "house-md:change->remote-auto-save#change focusout->remote-auto-save#submit", uploads_url: uploads_url(format: "json") } %>
<form data-controller="remote-auto-save paste autosave"
data-remote-auto-save-auto-save-outlet="#bubble_form"
data-autosave-key-value="draft-comment-<%= @bubble.id %>"
class="flex flex-column gap full-width"
data-action="paste->paste#pasteFiles remote-auto-save:success->autosave#clear">
<%= tag.house_md @bubble.draft_comment,
name: "bubble[draft_comment]",
class: "input comment__input",
form: "bubble_form",
placeholder: new_comment_placeholder(@bubble),
data: {
autosave_target: "input",
action: "house-md:change->remote-auto-save#change house-md:change->autosave#save focusout->remote-auto-save#submit",
uploads_url: uploads_url(format: "json")
} %>
</form>
</div>
</div>