Skip to content

w2grid: Handling of Shift+PgUp/PgDn is buggy #2658

@pfalcon

Description

@pfalcon

Short description
Shift+PgUp/PgDn are supposed to work in following way: the work exactly like plain PgUp/PgDn in terms of navigation, but also select rows between the last selected row and a new row it jumps to.

What is current behavior
Instead, what w2ui currently does is:

  • It doesn't select row range between "old" and "new" rows. It just selects (well, keeps selected) the old row and selects the new row. Again, rows in between are not selected.
  • Shift+PgDn doesn't allow to select last non-full "page" of rows. Consider how PgDn works: if you start on the first row, and press PgDn multiple times, you will eventually reach the last row. Shift+PgDn should work the same: starting with 1st row, and pressing Shift+PgDn multiple times, eventually you should have all rows selected. However, currently, w2ui will stop short of selecting last handful of rows which are not a "full page number" by which PgDn scrolls. (All the above applies to PgUp too, just in the "up" direction.)

Going deeper, I would argue that PgDn UX behavior is sub-ideal. Instead it should work like:

  1. Avoid scrolling whenever possible. That means that first press of PgDn should jump to the last currently visible row. Only if it's already on such row, it should scroll one page down. But:
  2. When scrolling, it still should keep user anchored at what they looks at. Specifically, this last visible row should become top visible row after scroll.

What is desired behavior
Described in subsections above.

Link to jsfidle/codepan with sample code
The issues described above can be seen at e.g. https://w2ui.com/web/demos/#/grid/2

Steps to reproduce or sample

  1. Click on row # 1.
  2. Observe that the last visible row is # 10.
  3. Press Shift+PgDn.
  4. Observe that the top row is now # 11. User lost visual connection regarding what happened to the grid. Again, the top row should be # 10, the one user could see before.
  5. Use mouse and scrollbar to scroll grid back to the top.
  6. Observe that rows # 1 and # 11 are selected. Again, all rows from # 1 to # 11 should have been selected instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions