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

#917
This commit is contained in:
Eric Liu 2021-11-19 08:29:16 -08:00 committed by GitHub
commit 4f83b2d1e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
}}" }}"