Skip to content

Commit

Permalink
TableOutputComponent: Fix backward search upon index 0
Browse files Browse the repository at this point in the history
Before this change, a backward search while selecting the first entry in
a table (index 0) would unselect it while trying to reach index -1.

Preserve such a selection instead, making the potential backward search
(user action) a no-op.

Contributes to fixing #859.

Signed-off-by: Marco Miller <marco.miller@ericsson.com>
  • Loading branch information
marco-miller committed Nov 1, 2022
1 parent 568db8e commit a0f2607
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ export class TableOutputComponent extends AbstractOutputComponent<TableOutputPro
currRowIndex = Math.max(this.selectStartIndex, this.selectEndIndex) + 1;
} else {
currRowIndex = Math.min(this.selectStartIndex, this.selectEndIndex) - 1;
if (currRowIndex < 0) {
// no backward search if already at index 0
return;
}
}
} else if (direction === Direction.PREVIOUS) {
// no backward search if there is no selection
Expand Down

0 comments on commit a0f2607

Please sign in to comment.