Skip to content

Commit 41fb2bf

Browse files
Francesco Moggia FFGfmoggia
Francesco Moggia FFG
authored andcommitted
fix(jqLite): find check if the element is a text node
find check if the element is a text node. If element is a text node return an empty array. Otherwise invoke getElementsByTagName on the element and return the result Closes angular#4120
1 parent 3e79c9b commit 41fb2bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jqLite.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,11 @@ forEach({
809809
},
810810

811811
find: function(element, selector) {
812-
return element.getElementsByTagName(selector);
812+
if (element.nodeType==3) {
813+
return [];
814+
} else {
815+
return element.getElementsByTagName(selector);
816+
}
813817
},
814818

815819
clone: jqLiteClone,

0 commit comments

Comments
 (0)