Skip to content

Commit

Permalink
TableOutputComponent: Fix findMatchedEvent row 0 case
Browse files Browse the repository at this point in the history
Before this change, if a column search filter highlighted entries
including the very first one in the table, then hitting Enter selected
the second highlighted entry, rather than that first one.

Contributes to fixing #859.

Signed-off-by: Marco Miller <marco.miller@ericsson.com>
  • Loading branch information
marco-miller committed Nov 1, 2022
1 parent 5d8c66e commit 568db8e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,8 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro
// non-contiguous row found, stop searching in cache
currRowIndexFound = false;
}
if (currRowIndexFound && !isFound && rowNode.rowIndex && rowNode.data && rowNode.data['isMatched']) {
// only checking 'rowNode.rowIndex' below makes its '=== 0' case false:
if (currRowIndexFound && !isFound && (rowNode.rowIndex || rowNode.rowIndex === 0) && rowNode.data && rowNode.data['isMatched']) {
this.gridApi?.ensureIndexVisible(rowNode.rowIndex);
this.selectStartIndex = this.selectEndIndex = rowNode.rowIndex;
if (this.timestampCol) {
Expand Down

0 comments on commit 568db8e

Please sign in to comment.