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

Logo link allow for the removal of target="_blank" #16782

Closed
dimitrieh opened this issue Nov 24, 2021 · 7 comments
Closed

Logo link allow for the removal of target="_blank" #16782

dimitrieh opened this issue Nov 24, 2021 · 7 comments

Comments

@dimitrieh
Copy link

Is your feature request related to a problem? Please describe

Currently, when configuring a URL for the logo in the top part of the sidebar it always opens up a new tab. Ideally, this should just take you to the page you configured it for without opening a new tab, especially when it is a page that has been configured as a home page.

Describe the solution you'd like

I would like to be able to flag the URL not to open a new tab, for example in the theming options.

Describe alternatives you've considered

There is currently no workaround, except for accepting the situation as is. Opening a new tab, closing the old one.

Are you able to assist to bring the feature to reality?
Potentially, if pointers are given.

Additional context
This is related to the comment at this issue #10647 (comment)

@waseemahmad31
Copy link

waseemahmad31 commented Nov 28, 2021

Hi

I can look into this issue. Just wanted to confirm before I make changes in the code, do we really want to remove target="_blank" or need to provide a configuration, so that users can configure how they want to navigate to the brand site? I can see this change was done as part of the pull request https://github.com/storybookjs/storybook/pull/6106/files.

@stale
Copy link

stale bot commented Jan 9, 2022

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 Jan 9, 2022
@dimitrieh
Copy link
Author

@waseemahmad31 I would say "provide a configuration".

I can see this change was done as part of the pull request https://github.com/storybookjs/storybook/pull/6106/files[](https://github.com/marketplace/stale).

From which version of Storybook would this new config be accessible?

@stale stale bot removed the inactive label Feb 28, 2022
@drcobel
Copy link

drcobel commented Jul 19, 2022

We have the same issue, running SB 6.5.9 React.
As UX designer the expected behavior when clicking the site logo is to return to the homepage without opening a new tab.
We should be able to configure it, but by default open the defined homepage on the same tab at least (it is really annoying to open a new tab each time)

@paulshryock
Copy link

paulshryock commented Dec 19, 2022

I feel that target="_blank" should be removed (as opposed to adding an override flag). I can't think of any benefit to having the logo hyperlink open in a new tab.

If it's a normal hyperlink (without target="_blank"), then the user can choose to either click and navigate in the same tab, or right click and "open in a new tab" if they want to. I feel the user should get to make that choice, not the application.

But if target="_blank" is left in, then my vote would be for at least adding the configuration override, and I want to recommend that rel="noopener noreferrer" should be added.

- <a href="#" target="_blank">...</a>
+ <a href="#" target="_blank" rel="noopener noreferrer">...</a>

Reasons to avoid target="_blank" without at least adding rel="noopener noreferrer":

@yannickoo
Copy link

I was just trying to achieve the same and it seems next to brandUrl there is also the brandTarget option, so you could do the following 🎉

.storybook/manager.js

addons.setConfig({
  theme: create({
    brandUrl: '/index.html',
    brandTarget: '_self',
  })
})

@paulshryock
Copy link

It's a shame to see this issue closed. Defaulting to an experience with both security and performance issues is a poor user experience.

It may be possible to find a "workaround" by opting-in to using brandTarget, but by default most users are getting a worse user experience than they could be. 🤷

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

No branches or pull requests

7 participants