NewTools icon indicating copy to clipboard operation
NewTools copied to clipboard

Subscribers reset the desiredVisibleRow in scrolling presenters

Open hernanmd opened this issue 1 year ago • 1 comments

One of the latests commits had to include a "hack" to update the desiredVisibleRow in a Spec tree presenter. The problem was discovered after expanding the path selection and scrolling to the selected item was not scrolling. But after debugging, it was actually scrolled, and another deferred action set back the idex to 1.

StDirectoryTreePresenter >> expandPath: aFileLocator [

	directoryTreePresenter
		selectPath: aPathForSpec
		scrollToSelection: true.

This happened because the Morphic configureScrolling is executed AFTER without an update to the new selected row index. Furthermore, the configureScrolling uses the desiredVisibleRow which is always set to 1.

The fix was to updates (manually) the desired visible row to the last visible index of whatever the selection is pointing to. But this probably should be done by Spec by default when the selected item is configured and scrolling is set to true.

Please let me know if this should be moved as Spec issue.

hernanmd avatar Sep 04 '24 13:09 hernanmd