File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react';
22import keycode from 'keycode' ;
33import classNames from 'classnames' ;
44import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper' ;
5-
5+ import ValidComponentChildren from './utils/ValidComponentChildren' ;
66import createChainedFunction from './utils/createChainedFunction' ;
77
88class DropdownMenu extends React . Component {
@@ -77,7 +77,7 @@ class DropdownMenu extends React.Component {
7777 }
7878
7979 render ( ) {
80- const items = React . Children . map ( this . props . children , child => {
80+ const items = ValidComponentChildren . map ( this . props . children , child => {
8181 let {
8282 children,
8383 onKeyDown,
Original file line number Diff line number Diff line change @@ -76,6 +76,15 @@ describe('DropdownMenu', function() {
7676 node . className . should . match ( / \b d r o p d o w n - m e n u - r i g h t \b / ) ;
7777 } ) ;
7878
79+ it ( 'handles empty children' , function ( ) {
80+ ReactTestUtils . renderIntoDocument (
81+ < DropdownMenu pullRight >
82+ < MenuItem > Item</ MenuItem >
83+ { false && < MenuItem > Item 2</ MenuItem > }
84+ </ DropdownMenu >
85+ ) ;
86+ } ) ;
87+
7988 describe ( 'focusable state' , function ( ) {
8089 let focusableContainer ;
8190
You can’t perform that action at this time.
0 commit comments