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

Addon-Docs: MDX links to internal docs cannot be opened in new tab #9502

Closed
zbream opened this issue Jan 16, 2020 · 6 comments · Fixed by #21569 or #21570
Closed

Addon-Docs: MDX links to internal docs cannot be opened in new tab #9502

zbream opened this issue Jan 16, 2020 · 6 comments · Fixed by #21569 or #21570

Comments

@zbream
Copy link

zbream commented Jan 16, 2020

Describe the bug

When writing MDX, opening an internal link in a new tab displays an error due to a malformed URL (see screenshot). This is related to the new NAVIGATE_URL functionality introduced in #9328, which is otherwise amazing btw.

The new URL has iframe.html before the query string, so presumably the manager isn't getting loaded in the new tab.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the following:
    https://storybookjs.now.sh/official-storybook/?path=/docs/addons-docs-mdx-in-story--typography#links
  2. Open link to another story (docs) in new tab, or middle click it.
  3. See error in new tab.

Expected behavior

The new tab should correctly load the linked docs page.

Screenshots

image

System:

  System:
    OS: Windows 10 10.0.17134
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Binaries:
    Node: 12.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Users\zream\AppData\Roaming\npm\yarn.CMD
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1098.0
@shilman shilman added this to the 5.3.x milestone Jan 17, 2020
@stale
Copy link

stale bot commented Feb 7, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Feb 7, 2020
@shilman shilman added the todo label Feb 7, 2020
@stale stale bot removed the inactive label Feb 7, 2020
@zbream
Copy link
Author

zbream commented Apr 28, 2020

I found a workaround while troubleshooting an unrelated problem with Angular routing in a story.

By adding <base href="/"> to preview-head.html, this goes away. Both relative and absolute links work perfectly, as far as I can tell.

I'm unsure if this has any broader implications, but perhaps this should come default on the existing <base target="_parent"> tag.


EDIT: Don't do this, it has broader implications! Turns out it breaks the header anchor links in docs, causing them to launch the manager within the preview frame.

@dimitrieh
Copy link

dimitrieh commented Feb 14, 2023

This issue continues to exist. Is the storybook development team aware of this navigation issue with their platform?

Also: #17921

Edit: Will be looking into if this issue persists in 7.0

cc: @yannbf

@dimitrieh
Copy link

dimitrieh commented Feb 15, 2023

I have created a test for internal linking for storybook 7.0 using beta 48 as this issue seems to persist there.

Other related issues:

cc: @yannbf

@shilman shilman added the mdx label Feb 24, 2023
@shilman shilman moved this to Required for GA in Core Team Projects Feb 24, 2023
@tmeasday tmeasday self-assigned this Mar 9, 2023
@tmeasday tmeasday moved this from Required for GA to In Progress in Core Team Projects Mar 13, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Core Team Projects Mar 16, 2023
@shilman
Copy link
Member

shilman commented Mar 17, 2023

Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-rc.4 containing PR #21569 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

@dimitrieh
Copy link

@shilman amazing! We'll be trying this out as soon as we migrated to 7.0 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment