Home | History | Annotate | only in /external/chromium-trace/catapult/third_party/polymer/components/iron-input
Up to higher level directory
NameDateSize
.bower.json06-Dec-20161.4K
.gitignore06-Dec-201617
.travis.yml06-Dec-2016789
bower.json06-Dec-20161.1K
CONTRIBUTING.md06-Dec-20163.4K
demo/06-Dec-2016
hero.svg06-Dec-2016752
index.html06-Dec-2016988
iron-input.html06-Dec-20169.9K
README.md06-Dec-20161.7K
test/06-Dec-2016

README.md

      1 
      2 <!---
      3 
      4 This README is automatically generated from the comments in these files:
      5 iron-input.html
      6 
      7 Edit those files, and our readme bot will duplicate them over here!
      8 Edit this file, and the bot will squash your changes :)
      9 
     10 The bot does some handling of markdown. Please file a bug if it does the wrong
     11 thing! https://github.com/PolymerLabs/tedium/issues
     12 
     13 -->
     14 
     15 [![Build status](https://travis-ci.org/PolymerElements/iron-input.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-input)
     16 
     17 _[Demo and API docs](https://elements.polymer-project.org/elements/iron-input)_
     18 
     19 
     20 ##&lt;iron-input&gt;
     21 
     22 `<iron-input>` adds two-way binding and custom validators using `Polymer.IronValidatorBehavior`
     23 to `<input>`.
     24 
     25 ### Two-way binding
     26 
     27 By default you can only get notified of changes to an `input`'s `value` due to user input:
     28 
     29 ```html
     30 <input value="{{myValue::input}}">
     31 ```
     32 
     33 `iron-input` adds the `bind-value` property that mirrors the `value` property, and can be used
     34 for two-way data binding. `bind-value` will notify if it is changed either by user input or by script.
     35 
     36 ```html
     37 <input is="iron-input" bind-value="{{myValue}}">
     38 ```
     39 
     40 ### Custom validators
     41 
     42 You can use custom validators that implement `Polymer.IronValidatorBehavior` with `<iron-input>`.
     43 
     44 ```html
     45 <input is="iron-input" validator="my-custom-validator">
     46 ```
     47 
     48 ### Stopping invalid input
     49 
     50 It may be desirable to only allow users to enter certain characters. You can use the
     51 `prevent-invalid-input` and `allowed-pattern` attributes together to accomplish this. This feature
     52 is separate from validation, and `allowed-pattern` does not affect how the input is validated.
     53 
     54 ```html
     55 <!-- only allow characters that match [0-9] -->
     56 <input is="iron-input" prevent-invalid-input allowed-pattern="[0-9]">
     57 ```
     58 
     59 
     60