Gatsby: Navigation on GatsbyJS.org

Created on 8 Jul 2017  Â·  9Comments  Â·  Source: gatsbyjs/gatsby

Hey all,

Not sure if this is the right place for this, but I was reading about Gatsby 1.0 today and pretty excited to try it, so I'm going through the Getting started page, and was a little confused (to put it mildly) when holding command (on OSX / Chrome) and clicking "Go to the tutorial" didn't open it in a new tab. At first I even thought my button was buggin', so I clicked the header links (which of course didn't work that way either). Fortunately I could at least right click it into a new tab, but for a moment it felt like an old-school flash application.

Now, I know this is sort of the point, that it's really fast and single-page, but this should really work. It might not be the end of the world, but as a power user, I certainly expect that to work.

All 9 comments

Just from that I would guess it's that first escape block if (ev.ctrlKey || ev.metaKey).. etc but ctrl + click still works to open the context-menu.

As a side note, in the starter kit, the default linking mechanism (gatsby-link) works fine.

Good to know! So yeah, it's almost certainly a bug then in the catch links
plugin. Could you try making a fix?

On Fri, Jul 7, 2017, 11:41 PM nkov notifications@github.com wrote:

As a side note, in the starter kit, the default linking mechanism works
fine.

—
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/1417#issuecomment-313838320,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVh_muzEM0pdedp002mKOKE0Od92l1ks5sLyR8gaJpZM4ORpnZ
.

Sure, I'll take a look, and maybe help with some documentation along the way.

Actually, I can't reproduce the problem locally. The plugin is working correctly (loads the link from markdown without reloading) and using command+click opens it in a new tab as expected.

The markdown is like this: Click [here](/page-two/)!

@KyleAMathews Could you post the markdown used on that page/site as maybe the problem could be found there?

Oooo I misunderstood your issue. It's not markdown links but actual gatsby-link links that's the problems.

We need to copy what react-router's Link component does

our onClick: https://github.com/gatsbyjs/gatsby/blob/02159f13ab42e2f69e273416b7ec6dab2aeda190/packages/gatsby-link/src/index.js#L47

RR onClick: https://github.com/ReactTraining/react-router/blob/676e8ac14da780e9fbd327576971fe549f3d0b8c/packages/react-router-dom/modules/Link.js#L40

I also noticed this with the gatsby starter today.

It's a little odd though... cmd+click on gatsby-links works correctly when running gatsby develop (opens a new tab), but when running gatsby build and serving that, cmd+click instead just behaves like a normal click.

I maybe could take a look into this in the next few days, unless someone beats me to it.

I'm working on a fix for this. Following Kyle's guidance above regarding RR's Link functionality.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

andykais picture andykais  Â·  3Comments

ferMartz picture ferMartz  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments

theduke picture theduke  Â·  3Comments