[MGNLUI-2643] TreeView should also scroll to selection when used from favorites or after a move action Created: 30/Jan/14  Updated: 27/Jun/14  Resolved: 10/Jun/14

Status: Closed
Project: Magnolia UI
Component/s: tree/list
Affects Version/s: 5.2.2
Fix Version/s: 5.2.7, 5.3

Type: Bug Priority: Critical
Reporter: Christopher Zimmermann Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 1
Labels: support, ux
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-2004 TreeViewImpl#select should cause sele... Closed
duplicate
is duplicated by MGNLUI-2926 If I click on a favorite that points ... Closed
is duplicated by MGNLUI-2697 Favorites do not focus, if app is alr... 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:

 Description   

Some improvements have been made in MGNLUI-2004 which causes correct behaviour when you switch views - for example switching from the search results view to the tree view. But there are other cases that still do not work correctly.
Known cases:

  • When you click on a favorite for an app that is already open, the list is not properly scrolled.
  • When you use the Move action, the list is not properly scrolled.

The reason I consider this critical is that the above functionality appears to not be working properly, you see the app, but not the item that you acted on.
Having a selected item that is offscreen is dangerous because you could perform an action - and not know which item you are acting on.

Note 1:
For the Move case, I thought the problem might be the early return in TreeViewImpl.select:
if (firstItemId == null || treeTable.isSelected(firstItemId))

{ return; }

Because basically it can't work with the above code because the item being moved was previously selected.

But even after commenting the 'return;' out it still did not work.

Note 2:
I notice that opening a bookmark does scroll to the item if the app is open - but a different subapp is open. It seems that something happens when the subapp switches which allows the treeTable.setCurrentPageFirstItemId(firstItemId); to work, but just when the subapp is already open (and somehow the state of the table has changed?) that the setCurrentPageFirstItemId does not work.



 Comments   
Comment by Mikaël Geljić [ 20/Feb/14 ]

Just rephrased title to highlight specific issue.

  • Please note as well that automatic scrolling is inherently buggy with these legacy Vaadin tables, and that we will eventually end up replacing them with the new Vaadin Grid component when it's released.
  • Finally, ticket shouldn't be in progress if it's not in the current maintenance changelog (5.2.3). Please check with Jan if we still have room for it (maintenance releases are limited to 50 tickets).
Comment by Aleksandr Pchelintcev [ 06/Jun/14 ]

I developed a small JS extension that connects to the table and sets the scrollTop of the body so that the specified row is in the viewport.
https://git.magnolia-cms.com/gitweb/?p=magnolia_ui.git;a=commit;h=91dd0d475c5425f46c2bec00eafe4cff25798248
https://git.magnolia-cms.com/gitweb/?p=magnolia_ui.git;a=commit;h=f433235ed9ce7d42d097d7a5afe8bf3032c7d337

Comment by Mikaël Geljić [ 10/Jun/14 ]

Needs backport to 5.2 — that's 5.2.7 probably

Comment by Aleksandr Pchelintcev [ 10/Jun/14 ]

Backport to version 5.2.7:
https://git.magnolia-cms.com/gitweb/?p=magnolia_ui.git;a=commit;h=d1606df329515bf535c541d4f68a4c04c5d84cca

Generated at Mon Feb 12 08:58:44 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.