Skip to content

Commit

Permalink
fixup! feat: change the way tabs behave on startup. Only render the c…
Browse files Browse the repository at this point in the history
…urrent tab
  • Loading branch information
tujoworker committed Feb 5, 2019
1 parent 1df2ef6 commit 5916591
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/dnb-ui-lib/src/components/tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ export default class Tabs extends PureComponent {
// check if we have to open a diffrent tab
if (props.use_hash && typeof window !== 'undefined') {
try {
selected_key = String(window.location.hash).replace('#', '')
console.log('selected_key', selected_key)
const key = String(window.location.hash).replace('#', '')
if (key && String(key).length > 0) {
selected_key = key
}
} catch (e) {
console.log('Tabs Error:', e)
}
Expand Down

0 comments on commit 5916591

Please sign in to comment.