I noticed that core-input<https://github.com/Polymer/core-input/blob/master/core-input.html>uses encapsulation rather than inheritance, so I wonder what the plan is for that element?
On Wed, Apr 9, 2014 at 7:13 AM, Addy Osmani <[email protected]> wrote: > Hey Gunter, > > Where you're looking to build an element that includes a significantly > close experience to something the browser already provides with an existing > element (e.g behaving like a standard DOM <input> element), extension is a > good way to go. We use this approach for the input elements that are > extended in the Polymer TodoMVC example over in > https://github.com/tastejs/todomvc/blob/gh-pages/architecture-examples/polymer/elements/td-input.html > . > > > On Wednesday, 9 April 2014 10:01:24 UTC+1, Günter Zöchbauer wrote: >> >> Hi Michael, >> >> Thanks for the reply, yes that helps. >> Didn't think of extending an existing element. >> I always try to avoid this because of the special syntax when using them. >> There seems to be no other way then? >> >> Mit freundlichen Grüßen >> >> Günter Zöchbauer >> [email protected] >> +43 (699) 10 18 87 15 >> >> >> On Wed, Apr 9, 2014 at 10:18 AM, Michael Bleigh <[email protected]>wrote: >> >>> I don't know all the ins and outs, but this appears to work for me: >>> >>> <!doctype html> >>> <html> >>> <head> >>> <script src="platform/platform.js"></script> >>> <link rel="import" href="polymer/polymer.html"> >>> <polymer-element name="super-input" extends="input" >>> attributes="value name" noscript> >>> <template> >>> <style>:host{ border: 0; padding: 0; }</style> >>> This is my <input value="{{value}}"> >>> </template> >>> </polymer-element> >>> </head> >>> <body> >>> <form method='get'> >>> <input is="super-input" value="whatever" name='test'> >>> <button type="submit">Submit</button> >>> </form> >>> </body> >>> </html> >>> >>> Hope that helps! >>> >>> On Wednesday, April 9, 2014 1:08:01 AM UTC-7, Günter Zöchbauer wrote: >>>> >>>> Is there a way to make a polymer element behave like a DOM input element >>>> - it's data gets sent on submit >>>> - participate in validation >>>> - ...? >>>> >>>> I thought this was a common requirement but I only found one unanswered >>>> SO question. >>>> >>>> Günter >>>> >>> 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/V0qah6T1Lzk/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/polymer-dev/edfd0548-21cd-4e25-b914-95a70b2795e3% >>> 40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/edfd0548-21cd-4e25-b914-95a70b2795e3%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/687c9c02-37d3-447a-aa73-c486d228569b%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/687c9c02-37d3-447a-aa73-c486d228569b%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/CAJup4OXR6qYHA_QjGWVCCcrS6BMuw_pH0FKu7AJFMUBPSfMJUA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
