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

Document data binding to form-like elements #286

Description

@hubgit

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions