File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export class MenuStore {
116
116
}
117
117
118
118
if ( isScrolledDown ) {
119
- const el = this . getElementAt ( itemIdx + 1 ) ;
119
+ const el = this . getElementAtOrFirstChild ( itemIdx + 1 ) ;
120
120
if ( this . scroll . isElementBellow ( el ) ) {
121
121
break ;
122
122
}
@@ -163,6 +163,18 @@ export class MenuStore {
163
163
return ( item && querySelector ( `[${ SECTION_ATTR } ="${ item . id } "]` ) ) || null ;
164
164
}
165
165
166
+ /**
167
+ * get section/operation DOM Node related to the item or if it is group item, returns first item of the group
168
+ * @param idx item absolute index
169
+ */
170
+ getElementAtOrFirstChild ( idx : number ) : Element | null {
171
+ let item = this . flatItems [ idx ] ;
172
+ if ( item && item . type === 'group' ) {
173
+ item = item . items [ 0 ] ;
174
+ }
175
+ return ( item && querySelector ( `[${ SECTION_ATTR } ="${ item . id } "]` ) ) || null ;
176
+ }
177
+
166
178
/**
167
179
* current active item
168
180
*/
You can’t perform that action at this time.
0 commit comments