Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting and removing focus in an empty input field with placeholder triggers change in IE #3377

Closed
fizker opened this issue Mar 11, 2015 · 5 comments · Fixed by #4051
Closed

Comments

@fizker
Copy link

fizker commented Mar 11, 2015

See http://jsfiddle.net/69z2wepo/3887/ for example code.

When setting and removing focus from an empty <input /> field with some placeholder text, the onChange event is triggered for IE 11 (I have not tested older versions). It does not trigger for other browsers.

My current work-around is to test the value that was last passed to the input with what is returned by event.target.value, and only act if they are different, but it would be nice if React would not send the change-event in the first place.

@jimfb
Copy link
Contributor

jimfb commented Mar 11, 2015

@spicyj Sounds like a browser quark that we should normalize against, right? Is there anything other than value that we would need to check?

@sophiebits
Copy link
Contributor

Yeah, this seems odd. Probably on the challenging side for a first bug, but it would be good to figure out why this is happening and how we can prevent it, while still making it possible to type the placeholder text in directly as @captray says.

@syranide
Copy link
Contributor

#2185, not really related but I imagine both could be solved by a similar fix.

@aronwoost
Copy link

Also goes for IE10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
@sophiebits @aronwoost @fizker @syranide @jimfb and others