Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_handleClickEvent(evt: MouseEvent): void {
const index = this._getListItemIndexByEvent(evt);
const target = evt.target as HTMLElement;
const listItem = this._getListItemByEventTarget(evt.target!);
if (listItem && listItem.disabled) {
return;
}
// Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.
const toggleCheckbox = !matches(target, strings.CHECKBOX_RADIO_SELECTOR);
this._foundation.handleClick(index, toggleCheckbox);
}