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(theme): ignored className attribute on lazy loaded TabItem #10219

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ function TabContent({
// fail-safe or fail-fast? not sure what's best here
return null;
}
return cloneElement(selectedTabItem, {className: 'margin-top--md'});
return cloneElement(selectedTabItem, {
className: clsx('margin-top--md', selectedTabItem.props.className),
});
}
return (
<div className="margin-top--md">
Expand Down
14 changes: 14 additions & 0 deletions website/_dogfooding/_pages tests/tabs-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,17 @@ export const isMacOS = typeof window !== 'undefined' && navigator.platform.start
```

When clicking tabs above, they should stay under cursor and we should adjust the scroll position.

## Tabs with className and lazy loading

<Tabs lazy>
<TabItem value="apple" label="Apple" className="alert alert--primary" default>
This is an apple 🍎
</TabItem>
<TabItem value="orange" label="Orange" className="alert alert--secondary">
This is an orange 🍊
</TabItem>
<TabItem value="banana" label="Banana" className="alert alert--success">
This is a banana 🍌
</TabItem>
</Tabs>