Injection of injection into polymer injection
1 answer
document-input inherits from core-input
, which fires an event change
when users press Enter / return or the element loses focus. If you don't care about the loss of focus case (for example, just for the case where the user presses ENTER), you can check document.activeElement
:
document.querySelector('paper-input').addEventListener('change', function(e) {
if (document.activeElement == this) {
console.log('ENTER hit on aper-input');
}
});
http://jsbin.com/godaqugacecu/1/edit
See http://www.polymer-project.org/docs/elements/core-elements.html#core-input .
+4
source to share