3 ms·
It doesn’t help that some web frameworks make it difficult to preserve the open in new tab behaviour
by quickthrower2 4y ago
It doesn’t help that some web frameworks make it difficult to preserve the open in new tab behaviour
- madeofpalk 4y agoWhat modern (last 10 years) web framework makes it difficult to have links be links?
- quickthrower2 4y agoNextJS complains if you don’t use their Link component, which in turn doesn’t allow open in new tab unless you nest a dummy <a> inside it. Because I think the Link uses onclick then if there is an immediate <a> child will set it up.
- leerob 4y agoThe <Link/> component is used for client-side page navigations in the same application. If you need to open links in a new tab with `target=“_blank”`, you should use the normal <a/> tag.
- pier25 4y agoThat's not what the parents are complaining about. It's when the user wants to open a regular link in a new tab using a key modifier.
- leerob 4y agoThis is working for me (just tested). Can you share one that isn’t please? I can investigate.
- pier25 4y agoHey Lee. I'm not saying it doesn't work :) I'm just saying they are talking about something else.
- quickthrower2 4y agoI just realized you work for Vercel, so how about I try to minimum reproduce then I can raise an Github issue?
- leerob 4y agoThat would be very helpful, thank you!
- quickthrower2 4y agoI have put a link to the issue in my HN profile. I think me providing the code will clear up the confusion as to what I think is a problem as we might all be talking about something different.
- quickthrower2 4y agoIt has been fixed in the canary version already. Nice. https://github.com/vercel/next.js/pull/36436 https://github.com/vercel/next.js/pull/36436
- quickthrower2 4y agoYeah the one thing I love to do, because hey it is the web, is open navigations in a new tab. For example when banking see my transactions in one tab while making a payment in the second. I hate sites that break that. Banks like to do that presumably for security theatre. NextJS makes it easy to mess up but once you know the trick it is ok - they should probably add a console warning for it.
- deleted 4y ago[deleted]