diff --git a/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/legacy_core_editor.ts b/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/legacy_core_editor.ts index 6262c304e307bf..8301daa675b5ce 100644 --- a/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/legacy_core_editor.ts +++ b/src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/legacy_core_editor.ts @@ -303,7 +303,9 @@ export class LegacyCoreEditor implements CoreEditor { const maxLineLength = this.getWrapLimit() - 5; const isWrapping = firstLine.length > maxLineLength; const getScreenCoords = (line: number) => - this.editor.renderer.textToScreenCoordinates(line - 1, startColumn).pageY - offsetFromPage; + this.editor.renderer.textToScreenCoordinates(line - 1, startColumn).pageY - + offsetFromPage + + (window.pageYOffset || 0); const topOfReq = getScreenCoords(startLine); if (topOfReq >= 0) {