core
core copied to clipboard
[Feature request] Officially support `collapsible: true` deeper than top level items
Clear and concise description of the problem
Currently, collapsible: true can be set on nested sidebar items and it does work, but the Typescript typings don't allow this so I have to cast to any.
The functionality today works how I would want it - the nested items under Attributes in my example below are listed when navigated into that section, and not listed when not in that section.
It is just that the documentation and the TS types try to discourage this usage. It would also be nice if the arrow to manually expand/collapse without navigating into the section could be rendered.
Suggested solution
Allow this to be an officially supported scenario without the cast to any on the child item:
sidebar: [
"/",
{
text: 'Model Components',
children: [
'/model-components/properties',
{
text: "Attributes",
link: '/model-components/attributes',
collapsible: true, // Allow this to work without TS workarounds.
children: fs
.readdirSync(path.resolve(__dirname, '../model-components/attributes'))
.map(f => '/model-components/attributes/' + f)
} as any,
'/modeling/model-components/methods',
],
},
]
Alternative
No response
Additional context
No response
This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.
Not stale - would still very much like to see this.
This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.
Hello, I would like this issue to be fixed too. I opened a pull request about 1 month ago. Have a maintainer a chance to look a it? Thanks