Skip to content

Commit eafdac8

Browse files
committed
fix(table): Hover over expandable row does not highlight parent row
1 parent 2d34a38 commit eafdac8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/table/table.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ import { I18n } from "./../i18n/i18n.module";
375375
[ibmDataGridFocus]="isDataGrid"
376376
[(columnIndex)]="columnIndex"
377377
[attr.colspan]="row.length + 2"
378+
(mouseenter)="addHoverClass($event)"
379+
(mouseleave)="removeHoverClass($event)"
378380
(click)="setExpandIndex($event)">
379381
<ng-container *ngIf="!firstExpandedTemplateInRow(row)">{{firstExpandedDataInRow(row)}}</ng-container>
380382
<ng-template
@@ -913,6 +915,14 @@ export class Table implements AfterViewInit {
913915
this.model.isEnd = false;
914916
}
915917

918+
addHoverClass(event) {
919+
event.target.closest("tr").previousElementSibling.classList.add("bx--expandable-row--hover-v2");
920+
}
921+
922+
removeHoverClass(event) {
923+
event.target.closest("tr").previousElementSibling.classList.remove("bx--expandable-row--hover-v2");
924+
}
925+
916926
handleTabIndex() {
917927
setTimeout(() => {
918928
const focusElementList = getFocusElementList(this.elementRef.nativeElement, tabbableSelectorIgnoreTabIndex);

0 commit comments

Comments
 (0)