Skip to content

Commit

Permalink
links should navigate in the parent window
Browse files Browse the repository at this point in the history
I found that creating normal `<a target="_blank" href="https://www.google.com">foo</a>` links inside of a story would update the iframe and not actually take the user out to the external link

`<base>`tag is supported by all browsers https://stackoverflow.com/a/2656798/1536309 

fixes storybookjs#1122
  • Loading branch information
blairanderson authored Aug 13, 2017
1 parent 4bd3312 commit 26f3134
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/react/src/server/iframe.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function({ assets, publicPath, headHtml }) {
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base target="_parent">
<script>
if (window.parent !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down

0 comments on commit 26f3134

Please sign in to comment.