AlexxNB / tinro

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

<a> link issues #50

Closed sourcegr closed 3 years ago

sourcegr commented 3 years ago

Hey Alex, great lib.

<a target="_blank" ... should open in new window

Clicking on any <a href=.... while holding the cmd (or ctrl in widows) should open in new window.

Edit: Actually, if any modifier key is pressed while clicking on the link, then the <a...> should not be handled by the lib.

AlexxNB commented 3 years ago

Is this issue for local links (started from /-sign) only, right?

sourcegr commented 3 years ago

Is this issue for local links (started from /-sign) only, right?

I believe so.

AlexxNB commented 3 years ago

Thanks, fixed in 0.5.10

sourcegr commented 3 years ago

@AlexxNB, control is used on windows, but in order to be usable on the mac, it should check for metaKey The modifier keys, do other stuff as well. Here is a (hopefully complete) list

I believe you should check for any modifier and cancel handling on any of them

Also: The target could be target="_self" meaning that the link should be handled by the lib.

Hope this helps :)

AlexxNB commented 3 years ago

Ok, will check all cases you wrote

AlexxNB commented 3 years ago

I added alt, ctrl, shift and meta keys. FYI, Ctrl+click - open in new tab, shift+click - open in new window. Thank you, again