From 68d403160c0c6f402f72855bd670c00c17c5cbd4 Mon Sep 17 00:00:00 2001 From: yang bo Date: Thu, 28 Jul 2022 23:12:53 +0800 Subject: [PATCH 1/2] fix: canvas support expand code for non-story --- code/lib/blocks/src/blocks/Canvas.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/code/lib/blocks/src/blocks/Canvas.tsx b/code/lib/blocks/src/blocks/Canvas.tsx index 5c2225273384..3641b422911d 100644 --- a/code/lib/blocks/src/blocks/Canvas.tsx +++ b/code/lib/blocks/src/blocks/Canvas.tsx @@ -34,6 +34,7 @@ const getPreviewProps = ( previewProps: { ...props, withSource: getSourceProps({ code: decodeURI(mdxSource) }, docsContext, sourceContext), + isExpanded: sourceState === SourceState.OPEN, }, }; } From 4ea22da7367559b9e9344e28c49610e32bd0ff7c Mon Sep 17 00:00:00 2001 From: yang bo Date: Thu, 28 Jul 2022 23:28:16 +0800 Subject: [PATCH 2/2] fix: update withSource=open example --- .../stories/addon-docs/addon-docs-mdx.stories.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/examples/official-storybook/stories/addon-docs/addon-docs-mdx.stories.mdx b/code/examples/official-storybook/stories/addon-docs/addon-docs-mdx.stories.mdx index e23e82ee2425..2538ddc4d9c9 100644 --- a/code/examples/official-storybook/stories/addon-docs/addon-docs-mdx.stories.mdx +++ b/code/examples/official-storybook/stories/addon-docs/addon-docs-mdx.stories.mdx @@ -196,6 +196,12 @@ Fixed layout requires custom `height` since it can't be determined. +### withSource="open" + + +

source open

+
+ ## Docs Disable