diff --git a/lib/services/XMLDisplayService/XMLDisplayService.js b/lib/services/XMLDisplayService/XMLDisplayService.js index d282245..ca69e6f 100644 --- a/lib/services/XMLDisplayService/XMLDisplayService.js +++ b/lib/services/XMLDisplayService/XMLDisplayService.js @@ -259,7 +259,10 @@ class XmlDisplayService { let domNode = null; while (domNode = results.iterateNext()) { - resultNodes.push(domNode); + // checking if the element is rendered, such that it can be highlighted and scrolled into view + if (domNode.checkVisibility()) { + resultNodes.push(domNode); + } } for (let i = 0; i < resultNodes.length; i++) { let text = resultNodes[i].innerHTML;