diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/interfaces.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/interfaces.ts index a7dfaa2794..6aac3fbb7b 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/interfaces.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/interfaces.ts @@ -73,16 +73,18 @@ export abstract class CellView extends AngularDisposable implements OnDestroy, I let elements = this.getHtmlElements(); if (elements?.length >= range.startLineNumber) { let elementContainingText = elements[range.startLineNumber - 1]; + let isCellActive = range.cell.active; let markCurrent = new Mark(elementContainingText); // to highlight the current item of them all. - markCurrent.markRanges([{ start: range.startColumn - 1, //subtracting 1 since markdown html is 0 indexed. length: range.endColumn - range.startColumn }], { className: findRangeSpecificClass, each: function (node, range) { - // node is the marked DOM element - node.scrollIntoView({ block: 'center' }); + if (isCellActive) { + // node is the marked DOM element + node.scrollIntoView({ block: 'center' }); + } } }); } diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/output.component.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/output.component.ts index f951cfe71b..83e8677d68 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/output.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/output.component.ts @@ -216,7 +216,7 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit { className: findRangeSpecificClass, each: function (node, range) { // node is the marked DOM element - node.scrollIntoView({ behavior: 'smooth', block: 'center' }); + node.scrollIntoView({ block: 'center' }); } }); } else if (elements?.length >= range.startLineNumber) { @@ -228,7 +228,7 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit { className: findRangeSpecificClass, each: function (node) { // node is the marked DOM element - node.scrollIntoView({ behavior: 'smooth', block: 'center' }); + node.scrollIntoView({ block: 'center' }); } }); } diff --git a/src/sql/workbench/contrib/notebook/browser/notebookEditor.ts b/src/sql/workbench/contrib/notebook/browser/notebookEditor.ts index ccc94d73d6..9bef480ab9 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookEditor.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookEditor.ts @@ -350,9 +350,6 @@ export class NotebookEditor extends EditorPane implements IFindNotebookControlle this._findDecorations.getCount(), this._currentMatch ); - if (this._finder.getDomNode().style.visibility === 'visible' && this._previousMatch !== this._currentMatch) { - this._setCurrentFindMatch(this._currentMatch); - } } }