Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleKeydown(evt: React.KeyboardEvent & KeyboardEvent) {
this.props.onKeyDown && this.props.onKeyDown(evt);
this.foundation.handleKeydown(evt);
// Jump through some hoops to find out
// that we are selecting the list item
// This is instead of trying to listen to an event on the list item
// which is what MDC does
if (
evt.which === 13 &&
evt.target instanceof Element &&
evt.target.classList.contains(List.cssClasses.LIST_ITEM_CLASS)
) {
this.foundation.handleItemAction(evt.target);
}
}