Skip to content

Widget API setSelectedRows causes a jump-to-top #2278

@Varamil

Description

@Varamil

Describe the current behavior

Use case:

  • Widget F : any widget that call the API function "setSelectedRows"
  • Widget T : a table widget, linked to the widget F
    So on widget T, only rows selected by the widget F are displayed.

After any update of the filtered rows by interacting with the widget F (that ends by a calling to "setSelectedRows"), if you try to select any available row in the widget T, on the focus, the 1st row is always selected whatever where you clicked on the table widget.

It may look minor issue, but here are two use cases that can have more impact:

  • Modify the wrong cell: if just after clicking on a cell, you look your keyboard to type what you want, yon don't see that the selection back to the 1st row and you update the wrong cell. By month of experience, it occurs often
  • Scroll roll-back: if the filter list remains long, and you scroll to find the row you want, if you click on it, the selection back to the 1st row and the scroll back to the top. So, you need to find again your item.

The example is with the simple filter widget, but observed with any filtering widget.

Steps to reproduce

  1. Go to the example : https://docs.getgrist.com/wrUr32FUVsDo/simple-filter
  2. Type "hotmail.com" in the Search
Image
  1. Try to select any cell on the row 10
  2. See even if the cell has been selected properly, it quickly jump to the 1st row
Image

Describe the expected behavior

The selected cell shouldn't change

Where have you encountered this bug?

Instance information (when self-hosting only)

  • Grist instance:

  • Browser name, version and platforms on which you could reproduce the bug: any browser (firefox, chrome...)

  • Link to browser console log if relevant: no

  • Link to server log if relevant: na

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions