From 77b1857786b02433c28891346bf1c40769f39c74 Mon Sep 17 00:00:00 2001
From: Marek Piasecki <mad@maniak.pro>
Date: Sat, 14 Jan 2023 21:06:05 +0100
Subject: [PATCH] move to the top after clicking link

---
 src/router_tag.imba | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/router_tag.imba b/src/router_tag.imba
index e7aed71..7cfdc19 100644
--- a/src/router_tag.imba
+++ b/src/router_tag.imba
@@ -18,7 +18,7 @@ tag pro-ref-f < a # f - forget current params in new destination
 
 	def render
 		let link = go || url
-		<self[d:inline].active=(R.to_path! == link) href=link @click.prevent=R.go(link)><slot>
+		<self[d:inline].active=(R.to_path! == link) href=link @click.prevent=(R.go(link); window.scrollTo(0,0))><slot>
 
 	get url
 		R.to_path view, params