Error when trying to mix Polymer controls with standard html 5 inputs

105 views
Skip to first unread message

jtho...@motorola.com

unread,
Oct 2, 2014, 4:58:15 PM10/2/14
to polym...@googlegroups.com
My tech stack is Appgyver Steroids app with Ionic.  I'm pulling in the paper elements cuz I like them.   BUT not all controls are there, like a date picker.  When I put in a standard date input (just html5) when I click it I get an error in polymer.  Is there any way I can put a catch in there so it's just ignored? I'd like to be able to co-mingle paper components and just standard html5.

my input:
 <label class="item item-input">
  <span class="input-label">Date</span>
  <input type="date">
</label>

the error:
[Error] UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0: The Event's type was not specified by initializing the event before the method was called.
dispatchEvent ([native code], line 0)
dispatchEvent (platform.js, line 13)
dispatchEvent (polymer.js, line 11)
fireEvent (polymer.js, line 11)
up (polymer.js, line 11)
up (polymer.js, line 11)
processTouches (polymer.js, line 11)
touchend (polymer.js, line 11)
(anonymous function) ([native code], line 0)
eventHandler (polymer.js, line 11)
(anonymous function) ([native code], line 0)
s (platform.js, line 12)
r (platform.js, line 12)
o (platform.js, line 12)
m (platform.js, line 12)

NOTE that I get this error when I attempt to use any form element in same page where i've loaded your platform.js and use paper components.

Scott Miles

unread,
Oct 3, 2014, 2:45:19 AM10/3/14
to jtho...@motorola.com, polymer-dev
Sounds like a bug in polymer-gestures. Would you mind filing an issue ticket? 


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/125dab74-12ab-4c1b-864d-368817a8479a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Thompson

unread,
Oct 3, 2014, 9:56:08 AM10/3/14
to polym...@googlegroups.com
Done...

thanks.   I'm trying hard to integrate the paper components because I really like the tactile response.   It's not easy still though because my app in an angular app, and while I see some ways out there that one can bind the two together, i've only been able to get that working for a variable.   what i need to find out how to get working is to be able to call an API in my controller from the web-component.    If you happen to know how pls point me in the right direction :)    

I think angular team is working on being able to have angular traverse shadow-com right? 

anyway thanks!



Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to a topic in the Google Groups "Polymer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/polymer-dev/MQZ4YkdkjEA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to polymer-dev...@googlegroups.com.



--
thanks,
Jeff

Scott Miles

unread,
Oct 3, 2014, 3:34:06 PM10/3/14
to Jeff Thompson, polymer-dev
The expectation is that you have your polymer-element fire an event instead of calling into a controller. You can attach a listener on or above it in the DOM tree, and listen for the signal.

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/CAEy6QoWJT61C%3DqEkuAEmKjTz83dVzjsn7XMpHZKNjXW6YbfXNQ%40mail.gmail.com.

Jeff Thompson

unread,
Oct 3, 2014, 3:45:01 PM10/3/14
to Scott Miles, polymer-dev
Hmmm... I like the way you think Scott ;)

So you just use the DOM itself as the conduit between the 2? meaning angular needs to listen for arbitrary window events (i.e. non-angular events)? 

One thing i have working though is if I just use the elements directly (i.e. don't declare my own with a shadow-dom) i can stay in angular space and just use like hg-click or whatever.. works like a charm.  it was only when i tried to make my own component (which IS of course the point after all) on then due to shadow-dom i predictably hit the issue.   

Am I correct in saying that the reason this happens is simply becuase of angular not seeing shadow-dom right?  so when angular team gets that released should be easier to play together, right? (or am i just WAY off?)

thanks Scott
--
thanks,
Jeff

Scott Miles

unread,
Oct 3, 2014, 4:05:11 PM10/3/14
to Jeff Thompson, polymer-dev
Yes, AFAIK, Angular currently cannot see ng-* inside of ShadowDOM. 

If possible, it's a good idea to code your Polymer elements so they are ignorant of your Angular setup, that will make things easier to move around and maintain.

Just a suggestion, mainly you gotta do what you gotta do. =P

Scott
Reply all
Reply to author
Forward
0 new messages