Is your element in the light DOM or your element's local DOM (shady/shadow
root)? If the latter, try Polymer.dom(this.root).firstElementChild.

On Mon, Jul 6, 2015 at 4:10 PM, John Jones <[email protected]> wrote:

> Whenever I try to use Polymer.dom(this).firstElementChild, it returns
> undefined.  By contrast, this.firstElementChild finds the element as I
> expect.
>
> ready: function() {
>   var child1 = Polymer.dom(this).firstElementChild; // undef
>   var child2 = this.firstElementChild;  // finds my child element
>   // do something with the child
> }
>
> I'm trying this because the docs for the DOM API (
> https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#dom-api)
> says "All DOM manipulation must use this API, as opposed to DOM API
> directly on nodes."
>
> Any ideas why this wouldn't be working?  Does the statement about not
> using DOM API directly really apply to properties like firstElementChild
> that don't manipulate the DOM?
>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/75309c99-de71-4ad3-af6a-8facd2129cd4%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/75309c99-de71-4ad3-af6a-8facd2129cd4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CACi5S_2nJcLrJxsy6wLANBeXdb8Z-_Ee6YV_6r4euA2EsmGBWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to