Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 580368

Summary: Avoid horizontal scrolling on extending row selection using keys
Product: [Technology] NatTable Reporter: Dirk Fauth <dirk.fauth>
Component: CoreAssignee: Dirk Fauth <dirk.fauth>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: kr
Version: 2.0.2   
Target Milestone: 2.0.3   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/194687
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=fd6cac57efd980627313741c94c4d561e18263d1
https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/194707
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=8d27827b225dade8b3ed7f4edc03509fb9d78eb2
Whiteboard:

Description Dirk Fauth CLA 2022-07-13 01:45:55 EDT
According to this forum post [1] there is an undesired behavior on extending a selection in a table with row-only selection via keys. If not all columns are visible, the viewport scrolls to the last column on pressing SHIFT + KEY_DOWN or KEY_UP

Steps to reproduce:
- create a table with RowSelectionModel and DefaultRowSelectionLayerConfiguration
- ensure that not all columns are visible and therefore horizontal scrolling is possible
- select a single row via click on a cell
- press SHIFT + KEY_DOWN

-> the table scrolls to the last column

The reason behind this behavior is that the MoveRowSelectionCommandHandler extends the MoveCellSelectionCommandHandler, which fires a CellSelectionEvent to bring the selected cell into the viewport and trigger a re-rendering to make the selection visible. The cell for which the event is triggered is the last selected cell in the selection region, which is in the last column for a row selection.


[1] https://www.eclipse.org/forums/index.php/t/1111171/
Comment 1 Eclipse Genie CLA 2022-07-13 01:47:19 EDT
New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/194687
Comment 2 Dirk Fauth CLA 2022-07-13 01:49:21 EDT
For the row selection configuration it is actually not necessary to fire a CellSelectionEvent. The row selection fires a RowSelectionEvent which triggers the necessary actions like bringing the selected row into the viewport and trigger a redraw to make the selection visible.
Comment 4 Dirk Fauth CLA 2022-07-13 03:27:58 EDT
*** Bug 580369 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Genie CLA 2022-07-14 06:59:23 EDT
New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/194707
Comment 7 Dirk Fauth CLA 2022-08-09 02:30:27 EDT
Released with 2.0.3