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

Fix Sections with href are always opening in new tabs #1564

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

mitsuruog
Copy link
Contributor

@mitsuruog mitsuruog commented Mar 17, 2020

Resolved.

The section does not open in the new tab unless href and external has set both.

please review me.

@@ -76,7 +76,7 @@ export default class TableOfContents extends Component<TableOfContentsProps> {
heading: !!section.name && children.length > 0,
content,
selected,
shouldOpenInNewTab: !!section.href,
shouldOpenInNewTab: !!section.external && !!section.href,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

external is an optional field.
undefined && true gives undefined, so I make force boolean cast here.

@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

Merging #1564 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
...rsg-components/TableOfContents/TableOfContents.tsx 97.77% <100.00%> (+0.05%) ⬆️

@sapegin sapegin merged commit 83fdb94 into styleguidist:master Mar 18, 2020
@sapegin
Copy link
Member

sapegin commented Mar 18, 2020

Thanks!

@styleguidist-bot
Copy link
Collaborator

🎉 This PR is included in version 11.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mitsuruog mitsuruog deleted the fix-1559 branch March 18, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants