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

Scroll continuously reverts to the top when another element on the document is updated #656

Closed
Paril opened this issue Aug 21, 2024 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@Paril
Copy link
Contributor

Paril commented Aug 21, 2024

We have a document that serves as a vault of content - the left 33% of the screen or so is a scrollable list of items, and the right side is a preview window which sometimes is scrollable.

We're not sure why, but, whenever the left side is scrolled down and an item is hovered which updates the preview on the right, the scroll container on the left jumps to the top. Looking at the call stack (breaking in SetBarPosition), it appears to be because of a document re-layout, but it's not retaining the previous scroll position.

It seems to hit this block a few times, but, this seems to be what's resetting the scroll area. There's not really anything special CSS-wise on the inner element;

Currently, this is my only workaround - it functions but it suggests to me that something is up:

	auto inner = doc->GetElementById("vault_items");
	auto top = inner->GetScrollTop();

	doc->UpdateDocument();

	inner->SetScrollTop(top);

I don't really understand why it's trying to re-layout #vault_items because it's not touched by the hover, only the right side box is. Removing the call to UpdateDocument doesn't change anything either, just defers the update to when Context::Update gets called.

@mikke89
Copy link
Owner

mikke89 commented Aug 21, 2024

Which commit of the library are you on? Could it be a duplicate of this one: #452? If so, try updating :)

@Paril
Copy link
Contributor Author

Paril commented Aug 21, 2024

Oh shoot I really should have searched closed issues. Darnit! I'm still on whatever the last 5.1 version was I think, and yeah that commit isn't in our build. I'm hesitant to upgrade to the full 6.x release for this project since we're so close to release - is there a commit you'd recommend that has bug fixes but is still 5.x interface?

@mikke89
Copy link
Owner

mikke89 commented Aug 21, 2024

Yeah, you can use the commit linked in the issue: 51af29b

You could cherry-pick that. There has been several changes around these parts though since 5.1, so it will likely need to be manually backported.

@Paril
Copy link
Contributor Author

Paril commented Aug 21, 2024

Ahh yeah I see. Okay. Thanks!

@Paril Paril closed this as completed Aug 21, 2024
@mikke89 mikke89 added the duplicate This issue or pull request already exists label Aug 21, 2024
@mikke89
Copy link
Owner

mikke89 commented Aug 21, 2024

Cheers, no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants