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

setting to anchor to focused cell #193833

Merged
merged 3 commits into from
Sep 22, 2023
Merged

setting to anchor to focused cell #193833

merged 3 commits into from
Sep 22, 2023

Conversation

amunger
Copy link
Contributor

@amunger amunger commented Sep 22, 2023

fixes #169038
fixes #193231

previously (in stable currently), the focused cell would be anchored only if the cell changing size was partially visible as shown in #193231. This will set the focused cell as anchored consistently by default, with a setting to disable that behavior.

Also changes the reveal full cell behavior back to revealing in the center, rather than pinning it to the bottom, which ended up focusing on the next cells output.

@@ -528,7 +528,7 @@ export class ListView<T> implements IListView<T> {
// do not scroll the viewport if resized element is out of viewport
heightDiff = size - originalSize;
} else {
if (anchorIndex !== null && anchorIndex > index && anchorIndex <= lastRenderRange.end) {
Copy link
Contributor Author

@amunger amunger Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a bug, the lastRenderRange.end is the index after the final visible index as documented in the indexAfter function, used by getRenderRange

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@amunger amunger merged commit 5601541 into main Sep 22, 2023
6 checks passed
@amunger amunger deleted the aamunger/anchorFocusedCell branch September 22, 2023 19:50
@joaomoreno
Copy link
Member

Unsure if this broke scrolling further, please read #193231 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

notebook scrolls up incorrectly when adjusting output heights Scroll top improvement based on context
4 participants