playbook_ui 13.29.0.pre.alpha.testingcollapsibleissue3052 → 13.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4dfe0653d86e536e79e7cd2537477204d815b54a27255442ac5ba1d6df6ac6d
4
- data.tar.gz: 8da9b6c0fb744f9a37347fdf3bec56a8c435a3aeeab1933d3441ef5cb6f846fb
3
+ metadata.gz: 699fcf293689b40e1140baca1e97a25053e322b9a4ca658717617798da963051
4
+ data.tar.gz: ef6ec517ea86e4440ee1bc196b05f9e449c7f1b9cd17dad24875193f1f5474d6
5
5
  SHA512:
6
- metadata.gz: 478df642a3c3079adf7eb546dc8f3a938717d5bb0f50d32e8dd70ebac1f6c16909fa21e613a262e2c94dcafbd5649acb2a2d3daa682ddc5a3f7961986d5aac37
7
- data.tar.gz: 0ed83b2e971d7bbf15df28168199a3a9d063abc043df74ea6ac1db4c95cbcfec79883f6c5cba1be43fe9fe9375d26f252ee07ed7f91781035837c8903314a766
6
+ metadata.gz: b5bae58e45a15ac46583dcbe34055089959cd988b1dc9f430340b550e35567d397dfd9a803f12ae4c4e7f14fdfa4cb1ae019f5cf085eb86c632644a655a188e1
7
+ data.tar.gz: 6e38e6533e9b495cdd3b7c2b85c37a57c37b4174eadbff01c77f939a65d67944d84e0db24af5247e7586374b1ce04314403e98570e1742feb68e8aaf68297b84
@@ -60,13 +60,14 @@ const Collapsible = ({
60
60
  }
61
61
 
62
62
  const FirstChild = children[0]
63
+ const SecondChild = children[1]
63
64
 
64
65
  const Main = FirstChild.type === CollapsibleMain ? FirstChild : null
65
- const Content = children[1]
66
+ const Content = SecondChild.type === CollapsibleContent ? SecondChild : null
66
67
 
67
68
 
68
69
  const { children: mainChildren = null, ...mainProps } = Main ? Main.props : {}
69
- const { children: contentChildren, ...contentProps } = Content.props
70
+ const { children: contentChildren = null, ...contentProps } = Content ? Content.props : {}
70
71
  const ariaProps = buildAriaProps(aria)
71
72
  const dataProps = buildDataProps(data)
72
73
  const htmlProps = buildHtmlProps(htmlOptions)
@@ -91,9 +92,12 @@ const Collapsible = ({
91
92
  ) : (
92
93
  FirstChild
93
94
  )}
95
+
96
+ {Content && (
94
97
  <CollapsibleContent {...contentProps}>
95
98
  {contentChildren}
96
99
  </CollapsibleContent>
100
+ )}
97
101
  </div>
98
102
  </CollapsibleContext.Provider>
99
103
  )