Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit d4e0620

Browse files
committed
Pass children elements to inside aspect ratio component
1 parent 5e8de84 commit d4e0620

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

packages/chakra-ui-core/src/CAspectRatioBox/CAspectRatioBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const CAspectRatioBox = {
6565
left: 0,
6666
...vnode.data.attrs
6767
}
68-
})
68+
}, vnode.componentOptions.children || [])
6969

7070
return h('div', {
7171
class: this.className,

packages/chakra-ui-core/src/CAspectRatioBox/CAspectRatioBox.stories.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,23 @@ storiesOf('UI | AspectRatioBox', module)
2222
}
2323
}
2424
}))
25+
.add('Nested Elements', () => ({
26+
components: { CAspectRatioBox, CBox },
27+
template: `
28+
<div style="width: 100vh; height: 100vw;">
29+
<CAspectRatioBox maxW="560px" :ratio="16 / 9" bg="gray.200">
30+
<CFlex align="center" justify="center">
31+
<CBox text-align="center">
32+
<CHeading>See the Vue</CHeading>
33+
<CText mt="4">Vue makes front-end development a breeze.</CText>
34+
</CBox>
35+
</CFlex>
36+
</CAspectRatioBox>
37+
</div>
38+
`,
39+
data () {
40+
return {
41+
showCollapsed: true
42+
}
43+
}
44+
}))

0 commit comments

Comments
 (0)