AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
669 stars 30 forks source link

Tinro should rewrite links on auxclick event too #111

Open mildred opened 2 years ago

mildred commented 2 years ago

When clicking a link, tinro aitomatically prepend the link with #/ to ensure we stay on the same page. This works well except when middle-clicking. In that case, Tinro should listen to the auxclick event to perform the same task.

https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event

The current implementation:

https://github.com/AlexxNB/tinro/blob/32038e776a9912265bdebe38a1d83214962792a8/src/router.js#L62-L81