PolymerElements / paper-input

A Material Design text field
https://www.webcomponents.org/element/PolymerElements/paper-input
130 stars 159 forks source link

onblur not fired on <paper-input> or native <input> #545

Open yebrahim opened 7 years ago

yebrahim commented 7 years ago

Description

I've been trying to set an event listener for blur on paper-input in Polymer 2.0, no matter what I do I can't get this to fire. focus fires just fine. Interestingly, if I drop any native input elements in my app, they also suffer the same problem. After I failed to do this in my Polymer app, I tried to do it in the Polymer starter kit 2, and got the same result, so this is probably an easy way to repro the issue.

Expected outcome

blur event should be fired.

Actual outcome

It's not.

Live Demo

I can't find a Polymer 2.0 CDN to put a demo here. I did try a few Polymer 1.x jsbins out there and it seems that issue isn't happening for Polymer 1.x.

Steps to reproduce

mkdir test && cd test
polymer init
# choose polymer-2-starter-kit
bower install --save PolymerElements/paper-input#2.0-preview

Now drop a <paper-input></paper-input> or a <input /> in any page, and add this to in in devtools: $0.onblur = function() { console.log('blurred');}. You could also try using the on-blur attribute.

Browsers Affected

Tested Chrome and Firefox, got this behavior on both.

Anky28 commented 7 years ago

I have same problem, But it's working well in chrome. on-blur is not supported in mozilla-firefox only