Skip to content

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

@edmellum

Description

@edmellum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions