Skip to content

Commit

Permalink
Use @observable.ref for hoveredStructVarTableRowIds
Browse files Browse the repository at this point in the history
PR feedback Aaron
  • Loading branch information
pvannierop committed Apr 17, 2023
1 parent 0b296c6 commit 9a1f2cf
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class StructuralVariantMultiSelectionTable extends React.Component<
modalPanelName: '',
};

@observable private hoveredStructVarTableRowIds: string[] = [];
@observable.ref private hoveredStructVarTableRowIds: string[] = [];

public static defaultProps = {
cancerGeneFilterEnabled: false,
Expand Down Expand Up @@ -635,9 +635,15 @@ export class StructuralVariantMultiSelectionTable extends React.Component<
@action.bound
onStructVarHover(rowId: string, isHovered: boolean) {
if (isHovered) {
this.hoveredStructVarTableRowIds.push(rowId);
this.hoveredStructVarTableRowIds = [
rowId,
...this.hoveredStructVarTableRowIds,
];
} else {
_.pull(this.hoveredStructVarTableRowIds, rowId);
this.hoveredStructVarTableRowIds = _.without(
this.hoveredStructVarTableRowIds,
rowId
);
}
}

Expand Down

0 comments on commit 9a1f2cf

Please sign in to comment.