[MGNLUI-5548] Grid on M.6-UI doesn't scroll to selected item if its outside the visible range Created: 07/Nov/19  Updated: 10/Jun/21  Resolved: 10/Dec/20

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.0, 6.1, 6.2
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Christoph Meier Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: ui-ux-impr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

(ce) test-webapp; 6.2-Snapshot; 2019.11.06 14:15:03


Attachments: File Kazam_screencast_00009.mp4     PNG File image-2019-12-04-12-34-14-335.png     PNG File image-2019-12-04-12-36-17-450.png     File vokoscreen-2019-12-04_12-41-21.mkv    
Issue Links:
duplicate
duplicates MGNLUI-6242 Scroll to selected item does not work... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Scroll to selected item

 Description   

Grid on M.6-UI doesn't scroll to selected item if its outside the visible range

Examples:

Dev notes:

https://vaadin.com/forum/thread/15758435/vaadin-8-grid-scrollto-x-but-where-is-x

The only solution listed in the thread is to fetch all items to get the index of the selected item (not nice, but we do it to get size of the datasource anyway). This applies only to list views (but we still need to make sure list are always ordered by default to always get the same order)

In the TreeGrid though, #scrollTo is deprecated (without replacement), but still usable to some degree. The selected row computation seems possible, would be quite complex though (get the root items, if expanded get the size of children..and recursively till we reach the selected item).



 Comments   
Comment by Anja von Gunten [ 12/Dec/19 ]

cmeier Yes from UX pov it's definitely a regression. When cross-linking to a node deep down in the grid, the grid should ideally show the selected item in a visible range.

Comment by Roman Kovařík [ 22/Jul/20 ]

https://vaadin.com/forum/thread/15758435/vaadin-8-grid-scrollto-x-but-where-is-x

The only solution listed in the thread is to fetch all items to get the index of the selected item (not nice, but we do it to get size of the datasource anyway). This applies only to list views (but we still need to make sure list are always ordered by default to always get the same order)

In the TreeGrid though, #scrollTo is deprecated (without replacement), but still usable to some degree. The selected row computation seems possible, would be quite complex though (get the root items, if expanded get the size of children..and recursively till we reach the selected item).

Comment by Simon Lutz [ 30/Jul/20 ]

Original ticket description:

I rephrase / update this ticket, since the "main issue" described as Case 2 in the Old description is not an issue anymore.

The remaining issues is not really a bug anymore, but it is a feature which is missing since we are using the Grod implementation of Vaadin 8 for the M.-6 UI frameworks.

Note that I also move the ticket from CFGUI to MGNLUI.
The issue type is still Bug - which is debatable, since we know that this is a result of what the Vaadin impl. can do (or cannot do).
However, note that the old m-5-UI-framework was able to scroll to the correct position, hence we can consider this a regression (at least from the UX point of view).

Whether we should tackle it, this should be decided by UX avongunten.

New summary:
Grid on M.6-UI doesn't scroll to selected item if its outside the visible range.

The issue appears e.g. when using the action Show in Resources app in the Definitions app.

Example

Show the resource restEndpoints/delivery/tourTypes_v1.yaml.
No need to start at the definitions app, just use the URLs below:


Old summary:

"Show in Resources app" link fails sometimes

Old description:

"Show in Resources app" link fails sometimes

Failures occur with different level of severity.

Case 0
sometimes the action does exactly what is expected.

Case 1
Nearly all good.
The tree at the resources app is opened as expected, but the row is not selected.

Case 2
The resources app gets opened, but the tree is completely closed, or may have the state of an earlier selection).
In this case, an exception (Nullpointer) is thrown silently (not visible on the UI); see stacktrace

This is a regression - the action works fine on demo (6.1.3) - but may fail on 6.2_SNAPSHOT (ce-test-webapp).

Comment by Simon Lutz [ 10/Dec/20 ]

Both issues described are solved by MGNLUI-6242. It will be released with 6.2.6.

Generated at Mon Feb 12 09:27:39 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.