We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a900425 commit 7aa6ff3Copy full SHA for 7aa6ff3
src/sandbox.js
@@ -31,7 +31,10 @@ function postMessage(action) {
31
function runQuery(rootNode, query) {
32
const result = parser.parse({ rootNode, query });
33
const selector = result.elements.map((x) => x.cssPath).join(', ');
34
- state.queriedNodes = Array.from(rootNode.querySelectorAll(selector));
+ state.queriedNodes =
35
+ result.elements.length > 0
36
+ ? Array.from(rootNode.querySelectorAll(selector))
37
+ : [];
38
state.highlighter.highlight({ nodes: state.queriedNodes });
39
return result;
40
}
0 commit comments