Skip to content

setting to anchor to focused cell - #193833

Merged
Aaron Munger (amunger) merged 3 commits into
mainfrom
aamunger/anchorFocusedCell
Sep 22, 2023
Merged

Aaron Munger (amunger) merged 3 commits into
mainfrom
aamunger/anchorFocusedCell

Conversation

@amunger

@amunger Aaron Munger (amunger) commented Sep 22, 2023 •

Copy link
Copy Markdown
Collaborator

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.

// do not scroll the viewport if resized element is out of viewport
heightDiff = size - originalSize;
} else {
if (anchorIndex !== null && anchorIndex > index && anchorIndex <= lastRenderRange.end) {

@amunger Aaron Munger (amunger) Sep 22, 2023 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@joaomoreno

Copy link
Copy Markdown
Contributor

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