yew/packages
Kai Salmon 1542e2b181
Only handle "normal" clicks on <Link>s (#3056)
* Fixing https://github.com/yewstack/yew/issues/2911

Prevents Link onclick behaviour from executing if the Ctrl key (for
Windows and Linux) or Meta Key (For Mac) is pressed.

This technically introduces a bug that means that links will reload the
page on windows machines when the windows key is held down. However,
this error is also in React Router, so I think we can get away with it.

See:
11156ac7f3/packages/react-router-dom/dom.ts (L29)

* Router Links now use default browser behaviour for alt and shift keys.

This change is inspired by 11156ac7f3/packages/react-router-dom/dom.ts (L29)

This allows uses to shift click links to save whatever the link points
at, and alt click on links to open them in new windows
2022-12-22 21:38:26 +01:00
..
2022-12-21 01:57:55 +00:00