Skip to content

Commit ecc797f

Browse files
chore: pointer only on selectable (#793)
1 parent 3722a76 commit ecc797f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

projects/components/src/table/table.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ $header-height: 32px;
4242
flex-direction: row;
4343
height: 44px;
4444
min-height: 44px;
45-
cursor: pointer;
45+
46+
&.selectable {
47+
cursor: pointer;
48+
}
4649

4750
&.selected-row {
4851
background: $blue-1;

projects/components/src/table/table.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ import { TableColumnConfigExtended, TableService } from './table.service';
144144
*cdkRowDef="let row; columns: this.visibleColumnIds$ | async"
145145
(mouseenter)="this.onDataRowMouseEnter(row)"
146146
(mouseleave)="this.onDataRowMouseLeave()"
147-
[ngClass]="{ 'selected-row': this.shouldHighlightRowAsSelection(row), 'hovered-row': this.isHoveredRow(row) }"
147+
[ngClass]="{
148+
'selected-row': this.shouldHighlightRowAsSelection(row),
149+
'hovered-row': this.isHoveredRow(row),
150+
selectable: this.supportsRowSelection()
151+
}"
148152
class="data-row"
149153
></cdk-row>
150154
@@ -691,6 +695,10 @@ export class TableComponent
691695
return this.selectionMode === TableSelectionMode.Multiple;
692696
}
693697

698+
public supportsRowSelection(): boolean {
699+
return this.hasMultiSelect() || this.hasSingleSelect();
700+
}
701+
694702
public isRowExpanded(row: StatefulTableRow): boolean {
695703
return this.hasExpandableRows() && row.$$state.expanded;
696704
}

0 commit comments

Comments
 (0)