| Summary: | selection anchor item must be cleared when ancestor of focused item is collapsed | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Grant Gayed <grant_gayed> | ||||||
| Component: | Client | Assignee: | libing wang <libingw> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | grant_gayed | ||||||
| Version: | 4.0 | Flags: | grant_gayed:
review+
|
||||||
| Target Milestone: | 4.0 RC2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Good catch. There is code handling the similar case for current selected item, I think I just forgot to sync the shiftAnchor. Created attachment 236379 [details]
Patch
The following case still shows the problem:
- select item b
- Ctrl+Select item c1
- collapse item c
- Shift+Select item f
-> selects items d-f, presumably because the selection count did not reach 0 when item c1 was collapsed
Created attachment 236412 [details]
second patch
(In reply to Grant Gayed from comment #3) > The following case still shows the problem: > > - select item b > - Ctrl+Select item c1 > - collapse item c > - Shift+Select item f > -> selects items d-f, presumably because the selection count did not > reach 0 when item c1 was collapsed Yeah, the issue is that there are remaining selections that are not collapsed. So I changed the logic as this: If there is an anchor and the anchor is in the refreshed selection list, then we just keep it. Otherwise just clear it. This logic is also good for thsi flow: 1.Click on a 2.Shift click on d. 3.Collapse c. 4.Shift click on f At step 3 in the rowChanged event handling, it does not change the shift anchor because the anchor is in the refreshed selection list. re-reviewed, seems fine Thanks for the review and the test cases, Grant. Pushed the fix with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ef4cf7f350a46679ac72a59699647471a935d541. |
I20131010-0722 Test case: item a item b item c +-----item c1 (child of item c) item d item e item f - give focus to item c1 - collapse item c - press down-arrow -> focus appears on item b, indicating that the collapsing of item c gave focus to item a (though its focus rect was not drawn) - re-expand item c - give focus to item c1 - collapse item c - shift+click on item f -> selection becomes d-f, because it's still using item c1 (which is conceptually between items c and d) as the anchor -> if item a is really the focus item at this point then it should be the anchor