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

Subscribers reset the desiredVisibleRow in scrolling presenters #833

Open
hernanmd opened this issue Sep 4, 2024 · 1 comment
Open

Subscribers reset the desiredVisibleRow in scrolling presenters #833

hernanmd opened this issue Sep 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hernanmd
Copy link
Member

hernanmd commented Sep 4, 2024

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 hernanmd added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@hernanmd and others