mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
fix(theme): ignored className attribute on lazy loaded TabItem (#10219)
This commit is contained in:
parent
88788cec90
commit
591914ca5c
2 changed files with 17 additions and 1 deletions
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue