File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,11 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
156156 this . setState ( { transitionMoveTarget : null } ) ;
157157 } else {
158158 const nextMenu = current . querySelector ( '#' + this . props . activeMenu ) || current || null ;
159- const nextMenuChildren = Array . from ( nextMenu . getElementsByTagName ( 'UL' ) [ 0 ] . children ) ;
160-
159+ const nextMenuLists = nextMenu . getElementsByTagName ( 'UL' ) ;
160+ if ( nextMenuLists . length === 0 ) {
161+ return ;
162+ }
163+ const nextMenuChildren = Array . from ( nextMenuLists [ 0 ] . children ) ;
161164 if ( ! this . state . currentDrilldownMenuId || nextMenu . id !== this . state . currentDrilldownMenuId ) {
162165 this . setState ( { currentDrilldownMenuId : nextMenu . id } ) ;
163166 } else {
@@ -167,7 +170,6 @@ class MenuBase extends React.Component<MenuProps, MenuState> {
167170 const nextTarget = nextMenuChildren . filter (
168171 ( el ) => ! ( el . classList . contains ( 'pf-m-disabled' ) || el . classList . contains ( styles . divider ) )
169172 ) [ 0 ] . firstChild ;
170-
171173 ( nextTarget as HTMLElement ) . focus ( ) ;
172174 ( nextTarget as HTMLElement ) . tabIndex = 0 ;
173175 }
You can’t perform that action at this time.
0 commit comments