Skip to content

Commit 4331890

Browse files
committed
Change active tab selection logic in TabbedCode component
1 parent dc8c184 commit 4331890

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/js/Components/TabbedCode.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TabbedCode = ({ className, examples, height }) => {
1717
const [codeTabs, setCodeTabs] = useContext(CodeTabContext) || useState({ unknown: 0 })
1818
const tabType = guessTabType(examples.map(example => example.name))
1919
const exampleIndex = examples.findIndex(example => codeTabs[tabType] === example.name)
20-
const activeTab = exampleIndex < 0 ? 0 : exampleIndex
20+
const activeTab = exampleIndex < 0 ? (examples.length - 1) : exampleIndex
2121

2222
return (
2323
<div className={className || 'my-8 overflow-hidden rounded'}>

0 commit comments

Comments
 (0)