mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 12:34:12 +00:00
Disable Turbo prefetch on dashboard outflow category links
Hovering over category links in the outflow donut chart triggered Turbo 8's default link prefetching, which made a real request to the transactions controller. The controller's store_params! before_action saved those filter params (category + date range) to the session. When the user later navigated to /transactions via the nav menu, the stored params were restored, showing an unexpected filtered view. Adding data-turbo-prefetch="false" prevents the prefetch on hover while preserving the intended click-to-navigate behavior. https://claude.ai/code/session_01Na7AF1wyidPwFdPq5w8oaw
This commit is contained in:
@@ -104,6 +104,7 @@
|
||||
class: "flex items-center justify-between mx-3 p-3 rounded-lg cursor-pointer group gap-3",
|
||||
data: {
|
||||
turbo_frame: "_top",
|
||||
turbo_prefetch: false,
|
||||
category_id: category[:id],
|
||||
action: "mouseenter->donut-chart#highlightSegment mouseleave->donut-chart#unhighlightSegment"
|
||||
} do %>
|
||||
|
||||
Reference in New Issue
Block a user