Skip to content

Commit 998a195

Browse files
committed
Fix scrolling when don't have focus (#11246)
1 parent 397555a commit 998a195

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

news/2 Fixes/11238.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix scrolling in a notebook whenever resizing or opening.

src/datascience-ui/react-common/monacoEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ export class MonacoEditor extends React.Component<IMonacoEditorProps, IMonacoEdi
551551

552552
private scrollToCurrentPosition(_editor: monacoEditor.editor.IStandaloneCodeEditor) {
553553
// Unfortunately during functional tests we hack the line count and the like.
554-
if (isTestExecution()) {
554+
if (isTestExecution() || !this.props.hasFocus) {
555555
return;
556556
}
557557
// Scroll to the visible line that has our current line. Note: Visible lines are not sorted by monaco

0 commit comments

Comments
 (0)