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

onChange on text input with placeholder fires without modifications in Internet Explorer #5438

Closed
edmellum opened this issue Nov 10, 2015 · 4 comments

Comments

@edmellum
Copy link
Contributor

Using IE 11 if one has an input component with a placeholder attribute and an onChange handler, the onChange handler will be called when clicking the input without typing anything in, just clicking it.

I made a reproducible case in codepen here: http://codepen.io/anon/pen/BoGQyZ If one opens it in IE and look in the console and clicks the input with the placeholder they should see an event from the onChange handler.

It seems to be a known issue that Microsoft is unwilling to fix. However if one of React's goals is to normalize the onChange event as the documentation implies this needs a workaround. One possible solution would be to check if the input that triggered an input event is focused at the moment.

@jimfb
Copy link
Contributor

jimfb commented Nov 10, 2015

@spicyj @syranide I know we intentionally don't/can't normalize everything. Is this something we care about normalizing?

@syranide
Copy link
Contributor

@jimfb I think it makes sense to normalize it, but unless we solve all of these problems then it seems kind of fruitless... and last I checked solving entirely in the event system didn't seem realistic. So that leaves solving it inside a wrapper-component which is trivial but would leave out the DOM bubbling (relying on that is a bad idea IMHO, but people do it), but it's trivial and safe to implement this wrapper-component yourself, so it doesn't seem very high priority to me.

That's what it seems like to me at least.

@jimfb
Copy link
Contributor

jimfb commented Nov 10, 2015

Ok, sounds like we probably won't invest time in solving this at the moment, but if @edmellum wants to file a pull request, it would be considered.

@sophiebits
Copy link
Collaborator

#4051 fixed this and will be in React v15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants