PolymerElements / iron-input

An input with data binding
https://webcomponents.org/element/PolymerElements/iron-input
33 stars 45 forks source link

Added blur event listener and _onBlur handler #35

Closed skullerj closed 9 years ago

skullerj commented 9 years ago

Sometimes it's useful to know when the user leaves the input. You can listen this event from your paper-input for instance using on-iron-input-blur="someHandler"

googlebot commented 9 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


skullerj commented 9 years ago

I signed it!

googlebot commented 9 years ago

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

notwaldorf commented 9 years ago

This isn't needed. Since iron-input is just a native input, the native events jsut work. Here is a jsbin demoing this: http://jsbin.com/xoceha/2/edit?html,output

Basically, you can just do:

document.querySelector('input[is="iron-input"]').addEventListener('blur', function() {
  console.log('blurred!');
});