From 6af27c91d8b82deaa827ef4c2791571708cfb0af Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 7 Oct 2025 10:11:05 +0200 Subject: [PATCH] Fix: anchor links to comments not working The problem was having the turbo frames as targets: their display: contents would make auto-scrolling not working! https://fizzy.37signals.com/5986089/cards/2190 --- app/views/cards/comments/_comment.html.erb | 6 +++--- app/views/cards/comments/edit.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/cards/comments/_comment.html.erb b/app/views/cards/comments/_comment.html.erb index 2c5083eaa..dafdb1c4e 100644 --- a/app/views/cards/comments/_comment.html.erb +++ b/app/views/cards/comments/_comment.html.erb @@ -1,7 +1,7 @@ <% cache comment do %> - <%= turbo_frame_tag comment do %> + <%= turbo_frame_tag comment, :container do %> <%# Bump for CSS changes: 2025-06-30 -%> -
" data-creator-id="<%= comment.creator_id %>" data-created-by-current-user-target="creation"> +
" data-creator-id="<%= comment.creator_id %>" data-created-by-current-user-target="creation"> @@ -13,7 +13,7 @@ <%= link_to comment.creator.name, comment.creator, class: "txt-ink btn btn--plain fill-transparent", data: { turbo_frame: "_top" } %> - <%= link_to comment, class: "txt-undecorated txt-ink translucent txt-normal txt-capitalize" do %> + <%= link_to comment, class: "txt-undecorated txt-ink translucent txt-normal txt-capitalize", data: { turbo_frame: "_top" } do %> <%= local_datetime_tag comment.created_at, style: :agoorweekday %>, <%= local_datetime_tag comment.created_at, style: :time %> <% end %> diff --git a/app/views/cards/comments/edit.html.erb b/app/views/cards/comments/edit.html.erb index 6feca97df..cb3011a37 100644 --- a/app/views/cards/comments/edit.html.erb +++ b/app/views/cards/comments/edit.html.erb @@ -1,4 +1,4 @@ -<%= turbo_frame_tag @comment do %> +<%= turbo_frame_tag @comment, :container do %>