Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
focusActiveNavigationItem: function () {
var activeNavItemEl = _this.root_.querySelector("." + MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS);
if (activeNavItemEl) {
activeNavItemEl.focus();
}
},
notifyClose: function () { return _this.emit(strings.CLOSE_EVENT, {}, true /* shouldBubble */); },
get listElements(): Element[] {
if (this.listItemElement.current) {
const listElement = closest(
this.listItemElement.current,
`.${MDCListFoundation.cssClasses.ROOT}`
);
if (!listElement) return [];
return [].slice.call(
listElement.querySelectorAll(
MDCListFoundation.strings.ENABLED_ITEMS_SELECTOR
)
);
}
return [];
}
get classes() {
const {
className,
activated,
disabled,
selected,
getClassNamesFromList,
} = this.props;
let classesFromList = [''];
if (this.listItemElement.current) {
const index = this.getIndex(this.listItemElement.current);
classesFromList = getClassNamesFromList!()[index];
}
return classnames('mdc-list-item', className, classesFromList, {
[MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS]: activated,
[MDCListFoundation.cssClasses.LIST_ITEM_SELECTED_CLASS]: selected,
'mdc-list-item--disabled': disabled,
});
}