Skip to content

Commit

Permalink
ignore select on button clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
madsrasmussen committed Nov 27, 2024
1 parent d7108d3 commit 49aae8c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/uui-base/lib/mixins/SelectableMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ export const SelectableMixin = <T extends Constructor<LitElement>>(

readonly #onClick = (e: Event) => {
const composePath = e.composedPath();
const isAnchorTag = composePath.some(el => {
const isActionTag = composePath.some(el => {
const element = el as HTMLElement;
return element.tagName === 'A';
return element.tagName === 'A' || element.tagName === 'BUTTON';
});

// never select when clicking on a link
if (isAnchorTag) return;
// never select when clicking on a link or button
if (isActionTag) return;

const isSelectable =
this._selectable || (this.deselectable && this.selected);
Expand Down

0 comments on commit 49aae8c

Please sign in to comment.