File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 167
167
return (listItem ?.hasCheckbox && listItem .checked ) ?? false ;
168
168
},
169
169
isFocusInsideList : () =>
170
+ element != null &&
170
171
getElement () !== document .activeElement &&
171
172
getElement ().contains (document .activeElement ),
172
- isRootFocused : () => document .activeElement === getElement (),
173
+ isRootFocused : () =>
174
+ element != null && document .activeElement === getElement (),
173
175
listItemAtIndexHasClass ,
174
176
notifyAction : (index ) => {
175
177
selectedIndex = index ;
176
- dispatch (getElement (), ' MDCList:action' , { index });
178
+ if (element != null ) {
179
+ dispatch (getElement (), ' MDCList:action' , { index });
180
+ }
177
181
},
178
182
removeClassForElementIndex ,
179
183
setAttributeForElementIndex ,
270
274
}
271
275
272
276
function getOrderedList() {
277
+ if (element == null ) {
278
+ return [];
279
+ }
280
+
273
281
return [... getElement ().children ]
274
282
.map ((element ) => itemAccessorMap .get (element ))
275
283
.filter (
You can’t perform that action at this time.
0 commit comments