Make comment body area permanent so that morphing/refresh does not touch it

This commit is contained in:
Jorge Manrubia
2025-11-13 16:52:54 +01:00
parent 88f1dd4b62
commit bddbc0c0ac
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
<% end %>
</div>
<div class="comment__body rich-text-content" data-controller="syntax-highlight retarget-links">
<div class="comment__body rich-text-content" data-controller="syntax-highlight retarget-links" data-turbo-permanent>
<%= comment.body %>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@
</figure>
<div class="comment__content flex-inline flex-column full-width">
<div class="comment__body rich-text-content">
<div class="comment__body rich-text-content" data-turbo-permanent>
<%= form_with model: Comment.new, url: card_comments_path(card), class: "flex flex-column gap full-width",
data: { controller: "form local-save",
local_save_key_value: "comment-#{card.id}",
+1 -1
View File
@@ -5,7 +5,7 @@
</figure>
<div class="comment__content flex flex-column flex-item-grow full-width">
<div class="comment__body rich-text-content">
<div class="comment__body rich-text-content" data-turbo-permanent>
<%= form_with model: [ @card, @comment ], class: "flex flex-column gap full-width",
data: { controller: "form", action: "keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel:stop" } do |form| %>
<%= form.rich_textarea :body, required: true, autofocus: true, placeholder: new_comment_placeholder(@card) do %>