Skip to content

Commit 49aae8c

Browse files
committed
ignore select on button clicks
1 parent d7108d3 commit 49aae8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/uui-base/lib/mixins/SelectableMixin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ export const SelectableMixin = <T extends Constructor<LitElement>>(
9595

9696
readonly #onClick = (e: Event) => {
9797
const composePath = e.composedPath();
98-
const isAnchorTag = composePath.some(el => {
98+
const isActionTag = composePath.some(el => {
9999
const element = el as HTMLElement;
100-
return element.tagName === 'A';
100+
return element.tagName === 'A' || element.tagName === 'BUTTON';
101101
});
102102

103-
// never select when clicking on a link
104-
if (isAnchorTag) return;
103+
// never select when clicking on a link or button
104+
if (isActionTag) return;
105105

106106
const isSelectable =
107107
this._selectable || (this.deselectable && this.selected);

0 commit comments

Comments
 (0)