Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-docs: Fix canvas support expand code for non-story #18808

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ Fixed layout requires custom `height` since it can't be determined.
</Story>
</Canvas>

### withSource="open"

<Canvas withSource="open">
<h2>source open</h2>
</Canvas>

## Docs Disable

<Story name="docs disable" parameters={{ docs: { disable: true } }}>
Expand Down
1 change: 1 addition & 0 deletions code/lib/blocks/src/blocks/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const getPreviewProps = (
previewProps: {
...props,
withSource: getSourceProps({ code: decodeURI(mdxSource) }, docsContext, sourceContext),
isExpanded: sourceState === SourceState.OPEN,
},
};
}
Expand Down