File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
- Call ` displayValue ` with a v-model of ` ref(undefined) ` on ` ComboboxInput ` ([ #1865 ] ( https://github.com/tailwindlabs/headlessui/pull/1865 ) )
13
13
- Improve ` Portal ` detection for ` Popover ` components ([ #1842 ] ( https://github.com/tailwindlabs/headlessui/pull/1842 ) )
14
+ - Fix crash when ` children ` are ` undefined ` ([ #1885 ] ( https://github.com/tailwindlabs/headlessui/pull/1885 ) )
14
15
15
16
## [ 1.7.2] - 2022-09-15
16
17
Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ describe('Safe guards', () => {
91
91
92
92
describe ( 'Rendering' , ( ) => {
93
93
describe ( 'Menu' , ( ) => {
94
+ it ( 'should not crash when rendering no children at all' , ( ) => {
95
+ renderTemplate ( jsx `
96
+ <Menu></Menu>
97
+ ` )
98
+ } )
99
+
94
100
it ( 'should be possible to render a Menu using a default render prop' , async ( ) => {
95
101
renderTemplate ( jsx `
96
102
<Menu v-slot="{ open }">
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ function _render({
108
108
}
109
109
110
110
if ( as === 'template' ) {
111
- children = flattenFragments ( children as VNode [ ] )
111
+ children = flattenFragments ( children ?? [ ] )
112
112
113
113
if ( Object . keys ( incomingProps ) . length > 0 || Object . keys ( attrs ) . length > 0 ) {
114
114
let [ firstChild , ...other ] = children ?? [ ]
You can’t perform that action at this time.
0 commit comments