Skip to content

Commit

Permalink
revert to none preventing approach
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Nov 26, 2024
1 parent 2bb4b11 commit ef1cbae
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/uui-base/lib/mixins/SelectableMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,7 @@ export const SelectableMixin = <T extends Constructor<LitElement>>(

if (isSelectable === false) return;

if (this.#selectableTarget === this) {
// If target is this, then only allow selection if the click is on the element itself.
if (e.composedPath().indexOf(this.#selectableTarget) === 0) {
if (e.type === 'keydown') {
e.preventDefault(); // Do not want the space key to trigger a page scroll.
}
this.#toggleSelect();
}
} else if (e.composedPath().indexOf(this.#selectableTarget) !== -1) {
if (e.composedPath().indexOf(this.#selectableTarget) !== -1) {
if (e.type === 'keydown') {
e.preventDefault(); // Do not want the space key to trigger a page scroll.
}
Expand Down

0 comments on commit ef1cbae

Please sign in to comment.