[go: up one dir, main page]

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

[regression] e.target for onChange is ndefined in 0.14.0-beta1 #4288

Closed
dantman opened this issue Jul 5, 2015 · 8 comments
Closed

[regression] e.target for onChange is ndefined in 0.14.0-beta1 #4288

dantman opened this issue Jul 5, 2015 · 8 comments

Comments

@dantman
Copy link
Contributor
dantman commented Jul 5, 2015

I tried updating from 0.14.0-alpha3 to 0.14.0-beta1.

Something has changed in between these releases that is making it so that e.target in onChange's synthetic event is undefined.

@dantman
Copy link
Contributor Author
dantman commented Jul 5, 2015

This appears to be related to a bug in src/renderers/dom/client/eventPlugins/ChangeEventPlugin.js. ChangeEventPlugin.extractEvents does not accept the nativeEventTarget argument and does not pass it on to SyntheticEvent.getPooled.

However that's not the only fix needed, manualDispatchChangeEvent also needs to pass something in place of the nativeEventTarget that SyntheticEvent.getPooled expects.

Also it seems BeforeInputEventPlugin has the same issue with nativeEventTarget being passed.

I tried fixing this myself. However I have issues with the test setup and/or the test utils seem incapable of triggering change from input.

dantman added a commit to dantman/react that referenced this issue Jul 5, 2015
@slorber
Copy link
Contributor
slorber commented Jul 7, 2015

Yes I can confirm I have this issue too! This unfortunately makes the beta unusable in my app.

The synteticEvent.target is null while the native event has a target

@chicoxyzzy
Copy link
Contributor

Same issue. The workaround is using e.currentTarget.value instead of e.target.value. But that's kinda wrong :(

@syranide
Copy link
Contributor
syranide commented Jul 8, 2015

Same here, but you can use e.nativeEvent.target for now.

@Jackien
Copy link
Jackien commented Jul 8, 2015

Excuse me. I'm a beginners of React. Can I ask a question? Why can I use "jsx -watch src/build" to translate "src/helloworld.js" file to plain JavaScrip?

@Jackien
Copy link
Jackien commented Jul 8, 2015

In fact, I can't see any result after do all steps。

@slorber
Copy link
Contributor
slorber commented Jul 8, 2015

@Jackien I don't know, but this is not the place for asking such questions. Ask this on Stackoverflow or IRC / Slack channels maybe

@Jackien
Copy link
Jackien commented Jul 8, 2015

@slorber Thank you for your answer.

jimfb added a commit that referenced this issue Jul 9, 2015
Fix event target for input change events.  Fixes #4288
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

5 participants