Skip to content

Commit

Permalink
Merge pull request #17906 from JonathanKolnik/jono/ch-1793-the-sideba…
Browse files Browse the repository at this point in the history
…r-is-still-appearing-in

UI: Fix canvas as initialActive for fullscreen mode in mobile
  • Loading branch information
shilman committed Apr 7, 2022
2 parents e973eea + 19de11a commit 6ade743
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/ui/src/components/layout/mobile.stories.tsx
Expand Up @@ -33,6 +33,13 @@ export const InitialAddons = ({ props }: { props: MobileProps }) => (
<Mobile {...props} options={{ ...props.options, initialActive: ActiveTabs.ADDONS }} />
);

export const Fullscreen = ({ props }: { props: MobileProps }) => (
<Mobile
{...props}
options={{ ...props.options, initialActive: ActiveTabs.SIDEBAR, isFullscreen: true }}
/>
);

export const DocsOnly = ({ props }: { props: MobileProps }) => <Mobile {...props} docsOnly />;

export const Page = ({ props }: { props: MobileProps }) => (
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/src/components/layout/mobile.tsx
Expand Up @@ -156,7 +156,7 @@ class Mobile extends Component<MobileProps, MobileState> {

const { options } = props;
this.state = {
active: options.initialActive || SIDEBAR,
active: options.isFullscreen ? CANVAS : options.initialActive || SIDEBAR,
};
}

Expand Down

0 comments on commit 6ade743

Please sign in to comment.