Skip to content

Programmatically trigger onChange for IE #9116

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

Closed
franz-see opened this issue Mar 5, 2017 · 3 comments
Closed

Programmatically trigger onChange for IE #9116

franz-see opened this issue Mar 5, 2017 · 3 comments

Comments

@franz-see
Copy link

I am trying to test my script by programatically triggering onChange on my class. But it doesnt seem to work on IE8. Kindly advice how to proceed.

I created this jsfiddle to show that : https://jsfiddle.net/9gzej3u5/4/

The top part shows a typical reactjs code wherein values typed in an input field automatically appears in a separate DOM element.

The bottom part is the code wherein I try to programatically set the value on the reactjs's input field and trigger a change event.

If the jsfiddle above is execute in a Chrome, Firefox, or Safari, the code works. If it is executed on an IE8 (for example), it fails.

Kindly advice how to programmatically an onChange event.

Thanks,
Franz

@aweary
Copy link
Contributor

aweary commented Mar 19, 2017

Hey, @franz-see! React uses a synthetic event system which does a lot of behind-the-scene work to normalize events across browsers. It's likely that you'll run into strange issues if you try to trigger native events manually like that.

Is there a specific use case you need to support?

Also, I tested in IE10 and it appears to work. Are you trying to get this working with IE8 specifically? If so, it's worth nothing that React no longer supports IE8.

@vitalyq
Copy link

vitalyq commented Apr 12, 2017

@aweary while the part that changes the element's value works, onChange handler is not invoked here. Actually it doesn't work in any IE at all.

The solution depends on what you are trying to achieve. Please check my answer in #3249.

@gaearon
Copy link
Collaborator

gaearon commented Oct 4, 2017

We don't support IE8 so I'll close this.

If you're experiencing problems in other versions please file a new bug with full instructions to reproduce and an example.

@gaearon gaearon closed this as completed Oct 4, 2017
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