When this.$() returns null

I’ve been doing some work in an implementation of View#didInsertElement in Ember 1.1.2 and am noticing that invoking this.$(‘.foo’) returns undefined if there is no element of class foo. However, jQuery returns an empty Array in this case. Is this intentional or a bug?

how about Ember.$('.foo')?

Hmm… haven’t checked that yet. But the idea is that this.$() will give me the jQuery element for that view, then I can essentially do a .find(‘.foo’) by just calling this.$(‘.foo’), but it should never return undefined.

But here is a jsfiddle that I think displays that it is working Ember Latest - JSFiddle - Code Playground

Just make sure your markup is correct, because I’ve seen scenarios where that breaks the traversing.

Hmmm… let me reduce my case down and see if it still shows…