Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

control key support and semantic links for dcc.Link #99

Closed
chriddyp opened this issue Oct 19, 2017 · 2 comments · Fixed by #215
Closed

control key support and semantic links for dcc.Link #99

chriddyp opened this issue Oct 19, 2017 · 2 comments · Fixed by #215

Comments

@chriddyp
Copy link
Member

chriddyp commented Oct 19, 2017

dcc.Link is the Dash single-page-app link component. There are still a few behaviours that make these links feel less like native links:

  1. Can't right-click on them
  2. Can't cntl-click to open new pages with them
  3. Visiting a new page keeps the scroll location at the bottom of the page, rather than bringing the user back to the top

For 3, we may need to solve this in the dash-renderer library, but I'm not sure.

It looks like we could use the logic in https://github.com/ReactTraining/react-router/blob/d6ac814e273b2f3aad24b7630a6f1df3f19c1475/packages/react-router-dom/modules/Link.js#L41-L62

@valentijnnieman
Copy link
Contributor

I'll pick this up, I think I can improve the Link component a bit. My thinking now after testing this out, is that an actual href attribute should be set on the <a> tag being rendered: this will give it some default styling (underline, blue color, hoverstate, etc) and will also allow users to right click etc. Then, I think we can prevent the tag from executing normally and using the Dash specified action instead.

@ned2
Copy link
Contributor

ned2 commented Jun 23, 2018

@valentijnnieman absolutely about setting an href. The limitations of not having an href on dcc.Link components has come up before here: #129 and @chriddyp put together a proposed solution here #130. But it looks like you're all over it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants