Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chriddyp opened this issue Oct 19, 2017 · 2 comments

Comments

@chriddyp
Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

commented Jun 22, 2018

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

This comment has been minimized.

Copy link
Contributor

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 join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.