Docz: Remember menu state

Created on 8 Jan 2019  路  6Comments  路  Source: doczjs/docz

The sidebar menu collapses each time I press a menu item in the default theme and it's pretty annoying to be honest :) Maybe an option to make the menu remember it's state or change the default behaviour.

Most helpful comment

This one is quite frustrating. Any ETA?

All 6 comments

i tested the examples:
basic is ok:
not collapse, has sub menu item
image

typescript has this problem:
collapses each time press a menu, not have sub menu item
image

typescript example can't render propsTable

export const Alert: SFC<AlertProps> = ({ kind, ...props }) => (
  <AlertStyled {...props} kind={kind} />
);

// must be written as
export const Alert = ({ kind, ...props }: AlertProps) => (
  <AlertStyled {...props} kind={kind} />
);

We don't use typescript but we do use styled-components. We don't see any sub menu items either.

I'm having the same issue; no submenu items and sidebar group collapses on navigation to another view. Not using TypeScript or Flow; just PropTypes for components.

Versions:

  • docz 0.13.7
  • docz-theme-default 0.13.7

Including the below info because we use an emotion ThemeProvider in the wrapper for docz:

  • @emotion/core ^10.0.4
  • @emotion/styled ^10.0.4
  • emotion-theming ^10.0.4

Possible culprit?

// wrapper component used in "doczrc.js"

import React from 'react';
import { ThemeProvider } from 'emotion-theming';
import theme from 'some/path';

export default function(props) {
  return <ThemeProvider theme={theme} {...props} />;
}

i tested the examples:
basic is ok:
not collapse, has sub menu item
image

typescript has this problem:
collapses each time press a menu, not have sub menu item
image

typescript example can't render propsTable

export const Alert: SFC<AlertProps> = ({ kind, ...props }) => (
  <AlertStyled {...props} kind={kind} />
);

// must be written as
export const Alert = ({ kind, ...props }: AlertProps) => (
  <AlertStyled {...props} kind={kind} />
);

hello , I see your submenu demo is perfect, may you share the code for this? because my submenu auto collapses every time, when i change menu active. Thanks

If is possible to unfold submenu default instand of collapses? submenu always collapses when i change active menu. Thanks

This one is quite frustrating. Any ETA?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

regrettably picture regrettably  路  3Comments

merelinguist picture merelinguist  路  3Comments

ilyanoskov picture ilyanoskov  路  3Comments

koddr picture koddr  路  3Comments

mquandalle picture mquandalle  路  3Comments