Skip to content

Commit 01f214d

Browse files
authored
Allow for WorkspaceItem to overflow its children as an exception (codesandbox#2190)
1 parent ebfde70 commit 01f214d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/Project/SandboxConfig/TemplateConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const TemplateConfig = observer(() => {
5959
};
6060

6161
return (
62-
<WorkspaceItem defaultOpen title="Template">
62+
<WorkspaceItem showOverflow defaultOpen title="Template">
6363
<Explanation style={{ marginTop: 0, marginBottom: '.5rem' }}>
6464
This is a template, you can find more info about templates
6565
<Link target="_blank" to={`/docs/templates`}>

packages/app/src/app/pages/Sandbox/Editor/Workspace/WorkspaceItem/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Props = {
1717
defaultOpen?: boolean;
1818
actions?: React.Component<any, any>;
1919
style?: React.CSSProperties;
20+
showOverflow?: boolean;
2021
};
2122

2223
type State = {
@@ -42,7 +43,15 @@ export default class WorkspaceItem extends React.Component<Props, State> {
4243
toggleOpen = () => this.setState({ open: !this.state.open });
4344

4445
render() {
45-
const { children, title, keepState, disabled, actions, style } = this.props;
46+
const {
47+
children,
48+
title,
49+
keepState,
50+
disabled,
51+
actions,
52+
style,
53+
showOverflow,
54+
} = this.props;
4655
const { open } = this.state;
4756

4857
return (
@@ -56,7 +65,7 @@ export default class WorkspaceItem extends React.Component<Props, State> {
5665
<ReactShow
5766
style={{
5867
height: 'auto',
59-
overflow: 'hidden',
68+
overflow: showOverflow ? 'initial' : 'hidden',
6069
}}
6170
transitionOnMount
6271
start={{

0 commit comments

Comments
 (0)