Skip to content

Commit 919b44d

Browse files
committed
allow html-element in element search
1 parent fb6a5a1 commit 919b44d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ember_debug/libs/render-tree.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class InElementSupportProvider {
3636
owner.lookup('renderer:-dom')?.debugRenderTree ||
3737
owner.lookup('service:-glimmer-environment')._debugRenderTree;
3838
this.NewElementBuilder = this.runtime.NewElementBuilder;
39-
40-
this.patch();
4139
}
4240

4341
reset() {
@@ -116,6 +114,9 @@ class InElementSupportProvider {
116114
return node;
117115
};
118116

117+
if (!NewElementBuilder) {
118+
return;
119+
}
119120
const didAppendNode = NewElementBuilder.prototype.didAppendNode;
120121
NewElementBuilder.prototype.didAppendNode = function (...args) {
121122
args[0].__emberInspectorParentNode = componentStack.at(-1);
@@ -314,6 +315,7 @@ export default class RenderTree {
314315
this._reset();
315316
try {
316317
this.inElementSupport = new InElementSupportProvider(owner);
318+
this.inElementSupport.patch();
317319
} catch (e) {
318320
console.error('failed to setup in element support');
319321
console.error(e);
@@ -803,8 +805,7 @@ export default class RenderTree {
803805
while (candidates.length > 0) {
804806
let candidate = candidates.shift();
805807
let range = this.getRange(candidate.id);
806-
const isAllowed =
807-
candidate.type !== 'modifier' && candidate.type !== 'html-element';
808+
const isAllowed = candidate.type !== 'modifier';
808809

809810
if (!isAllowed) {
810811
candidates.push(...candidate.children);

0 commit comments

Comments
 (0)