Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/11238.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix scrolling in a notebook whenever resizing or opening.
2 changes: 1 addition & 1 deletion src/datascience-ui/react-common/monacoEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ export class MonacoEditor extends React.Component<IMonacoEditorProps, IMonacoEdi

private scrollToCurrentPosition(_editor: monacoEditor.editor.IStandaloneCodeEditor) {
// Unfortunately during functional tests we hack the line count and the like.
if (isTestExecution()) {
if (isTestExecution() || !this.props.hasFocus) {
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering if anything relied on the previous behavior where you could do this to an out of focus cell. But I'm not seeing anything. So looks good.

Copy link
Member

Choose a reason for hiding this comment

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

Even if it did, I'm guessing that the current behavior is much worse than whatever we'd be breaking.

return;
}
// Scroll to the visible line that has our current line. Note: Visible lines are not sorted by monaco
Expand Down