jQuery hide('fast') function doest not work inside from Shadow DOM

140 views
Skip to first unread message

Carlos Alberto Castaño García

unread,
May 14, 2014, 1:07:24 AM5/14/14
to polym...@googlegroups.com
Hi,

I'm testing Custom Elements and I've found this:

$.hide('fast') ---> Doesn't work inside Shadow DOM
$.hide() ----> Works on Shadow DOM

Out Shadow DOM both works.


Some idea?

Thanks

Daniel Freedman

unread,
May 14, 2014, 7:57:22 PM5/14/14
to Carlos Alberto Castaño García, polymer-dev
Hi Carlos,

It looks like jQuery does some "is this element in the document" checks before deciding to apply the animation.
However, ShadowDOM spec says that document.contains(someNodeInShadowRoot) should return false for encapsulation reasons.

Polymer's gesture library implements a "deepContains" method that works around the ShadowDOM limitation.
As a total hack, I tried setting jQuery.contains = PolymerGestures.deepContains, and that worked.

This is absolutely not supported, and I'm suprised it worked, but maybe you can use that for now.

I suspect that jQuery will have to implement something similar to support ShadowDOM's notion of contains sooner or later.


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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/75036026-ec35-448d-97ef-5f120572c76e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos Alberto Castaño García

unread,
May 14, 2014, 11:36:38 PM5/14/14
to polym...@googlegroups.com, Carlos Alberto Castaño García
Nice job Daniel!.. thanks so much, it works perfectly
Reply all
Reply to author
Forward
0 new messages