Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes tree view falsely scrolls on node expansion #39

Open
jjac opened this issue Jan 11, 2012 · 0 comments
Open

Nodes tree view falsely scrolls on node expansion #39

jjac opened this issue Jan 11, 2012 · 0 comments

Comments

@jjac
Copy link

jjac commented Jan 11, 2012

Steps to reproduce

This false behavior may happen on two occasions:

  • Select a node, scroll down to some other distant node, expand it and the browser will scroll back to the original node
  • Make sure no node is selected (e.g. expand and collapse a node that is the direct ancestor of a selected node). Then scroll down to some other distant node, expand it and the browser will scroll to the direct ancestor of the expanded node - possibly scrolling the just expanded node out of the visible area.

Expected behavior

When expanding a node the scroll position of the surrounding view should stay in the area so that the user can watch the effect of the expansion.

Code Analysis

The first behavior mentioned is due to a side effect of selectNode: which will be called when the expanded state is restored in

-[IMBNodeViewController _nodesDidChange]

The second behavior mentioned is due to a side effect of a recent change in

-[IMBLibraryController _replaceNode:withNode:parentNodeIdentifier:]

in which a workaround was implemented to avoid a 'nasty crashing bug' (see lines 710ff):

[parentNode setSubNodes:nil];       // Important workaround. Do not remove!

This workaround causes the NSOutlineView to scroll to parentNode.

Suggested Fix

After aeons of analyzing the control flow involved I found the fix to be a simple save/restore pattern of the current scroll position (to be inserted at the right places). I intend to deliver the fix along with the upcoming Photo Stream pull request.

jjac pushed a commit to jjac/iMedia that referenced this issue Jan 11, 2012
redsweater pushed a commit to redsweater/iMedia that referenced this issue Apr 8, 2013
…nce thumbnail and metadata are (asynchronously) loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant