mateothegreat / svelte5-router

An SPA router for Svelte that allows you to divide & conquer your app with nested routers.
https://svelte5-router.vercel.app
MIT License
61 stars 4 forks source link

ctrl + clicking links with use:route does not open in new target #21

Open RingOfStorms opened 11 hours ago

RingOfStorms commented 11 hours ago

Opening links in a new tab is an expected behavior of links. The action provided by use:route overrides this. I'd consider this a bug.

This other svelte5-router library does a great job at dealing with links and binding them. This is the only thing that library does better than this one, so I will just be taking some of the logic into my own app for now but I would highly recommend doing similar logic, esp in regards to the meta/alt/ctrl/shift key, and target checks.

https://github.com/jpcutshall/svelte5-router/blob/master/src/lib/actions.ts

RingOfStorms commented 11 hours ago

Also a top level bind:links like in that other lib would be awesome in this one as well, so that every link doesn't need to use the bind directly every time.

RingOfStorms commented 10 hours ago

https://github.com/mateothegreat/svelte5-router/pull/22 fixes this behavior and pulls in the code that the other library used for this logic. Also introduced a top level action