From 2dab14ef64d673d551890826dbedcf6f46d1bccf Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Wed, 12 Nov 2025 18:14:31 +0100 Subject: [PATCH] Replace the full container since we want to get back to the initial state To see the boost button again --- app/views/cards/comments/reactions/create.turbo_stream.erb | 4 +++- app/views/cards/comments/reactions/new.html.erb | 2 +- test/controllers/cards/comments/reactions_controller_test.rb | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/cards/comments/reactions/create.turbo_stream.erb b/app/views/cards/comments/reactions/create.turbo_stream.erb index 7ae1f1daa..7ac4b61df 100644 --- a/app/views/cards/comments/reactions/create.turbo_stream.erb +++ b/app/views/cards/comments/reactions/create.turbo_stream.erb @@ -1 +1,3 @@ -<%= turbo_stream.append([ @comment, :reactions ], partial: "cards/comments/reactions/reaction", locals: { reaction: @reaction }) %> +<%= turbo_stream.replace([ @comment, :reacting ]) do %> + <%= render "cards/comments/reactions/reactions", comment: @comment.reload %> +<% end %> diff --git a/app/views/cards/comments/reactions/new.html.erb b/app/views/cards/comments/reactions/new.html.erb index e847acfbe..38c6daf98 100644 --- a/app/views/cards/comments/reactions/new.html.erb +++ b/app/views/cards/comments/reactions/new.html.erb @@ -2,7 +2,7 @@ <%= form_with model: [ @comment.card, @comment, Reaction.new ], class: "reaction reaction__form expanded", html: { aria: { label: "New reaction" } }, - data: { controller: "form reaction-emoji", turbo_frame: dom_id(@comment, :reacting), action: "keydown.esc->form#cancel submit->form#preventEmptySubmit turbo:submit-end->form#reset" } do |form| %> + data: { controller: "form reaction-emoji", turbo_frame: dom_id(@comment, :reacting), action: "keydown.esc->form#cancel submit->form#preventEmptySubmit" } do |form| %>