mirror of
https://github.com/Redocly/redoc.git
synced 2025-04-21 17:21:58 +03:00
Update Tag Groups to be Collapsible
This commit is contained in:
parent
05a85711e1
commit
c5af081fc6
|
@ -53,7 +53,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
|||
{item.sidebarLabel}
|
||||
{this.props.children}
|
||||
</MenuItemTitle>
|
||||
{(item.depth > 0 && item.items.length > 0 && (
|
||||
{(item.items.length > 0 && (
|
||||
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
|
||||
)) ||
|
||||
null}
|
||||
|
|
|
@ -56,9 +56,9 @@ export class GroupModel implements IMenuItem {
|
|||
this.parent = parent;
|
||||
this.externalDocs = (tagOrGroup as OpenAPITag).externalDocs;
|
||||
|
||||
// groups are active (expanded) by default
|
||||
// groups are active but not expanded by default
|
||||
if (this.type === 'group') {
|
||||
this.expanded = true;
|
||||
this.activate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,10 +77,6 @@ export class GroupModel implements IMenuItem {
|
|||
|
||||
@action
|
||||
collapse() {
|
||||
// disallow collapsing groups
|
||||
if (this.type === 'group') {
|
||||
return;
|
||||
}
|
||||
this.expanded = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user