Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Document data binding to form-like elements #286

Open
hubgit opened this issue Aug 17, 2016 · 1 comment
Open

Document data binding to form-like elements #286

hubgit opened this issue Aug 17, 2016 · 1 comment

Comments

@hubgit
Copy link

hubgit commented Aug 17, 2016

The elements catalog is great, but there's something that would be a useful addition for the form elements (inputs, checkboxes, etc): documentation and examples of how to bind data to each element. This is particularly necessary because the binding attribute is different for almost every element type.

For example:

  • Binding to paper-input uses the value attribute (but this is only mentioned in the doc for the value attribute, as "The value for this input").
  • paper-textarea also uses the value attribute (documented briefly as "The value for this element."). It would be useful to mention that this is different from the behaviour with a standard textarea, where the value goes inside the tag rather than as an attribute.
  • paper-checkbox and paper-toggle-button have a value attribute (doc "Overriden from Polymer.IronFormElementBehavior"), but it's actually the "checked" attribute that the data should be bound to.
  • paper-listbox uses a selected attribute for the selected value (via attr-for-selected if needed), but then if multi is set you have to bind to selected-values instead. This is documented as "Gets or sets the selected elements. This is used instead of selected when multi is true." but again is hard to find unless you already know where to look.

Maybe each element needs a "Binding" section?

@lawilli
Copy link

lawilli commented Nov 4, 2016

@hubgit The respective repos of the cited elements might be more fitting of a place for these issues. For instance, the docs you see in the Element Catalog for <paper-input> was generated from the source of <paper-input>. The element catalog parses those documentation comments when the catalog is built.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants