fix(data-table): forgo "click", "click:row" events if target is an OverflowMenu

#917
This commit is contained in:
metonym 2021-11-19 08:06:02 -08:00
commit e2ebaad576

View file

@ -336,7 +336,15 @@
: ''} {expandable && parentRowId === row.id : ''} {expandable && parentRowId === row.id
? 'bx--expandable-row--hover' ? 'bx--expandable-row--hover'
: ''}" : ''}"
on:click="{() => { on:click="{({ target }) => {
// forgo "click", "click:row" events if target resembles an overflow menu
if (
[...target.classList].some((name) =>
/^bx--overflow-menu/.test(name)
)
) {
return;
}
dispatch('click', { row }); dispatch('click', { row });
dispatch('click:row', row); dispatch('click:row', row);
}}" }}"