Skip to content

Commit 9475a7b

Browse files
committed
add to const
1 parent 5c631d3 commit 9475a7b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

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

9696
readonly #onClick = (e: Event) => {
9797
const composePath = e.composedPath();
98+
const isSelectable =
99+
this._selectable || (this.deselectable && this.selected);
98100

99-
if (
100-
(this._selectable || (this.deselectable && this.selected)) &&
101-
this.selectableTarget === this
102-
) {
101+
if (isSelectable && this.selectableTarget === this) {
103102
this.#toggleSelect();
104103
return;
105104
}
106105

107-
if (
108-
(this._selectable || (this.deselectable && this.selected)) &&
109-
composePath.indexOf(this.selectableTarget) === 0
110-
) {
106+
if (isSelectable && composePath.indexOf(this.selectableTarget) === 0) {
111107
this.#toggleSelect();
112108
}
113109
};

0 commit comments

Comments
 (0)