Skip to content

LinkedValueUtils:requestOnChange event.target is undefined #4438

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
sarink opened this issue Jul 20, 2015 · 1 comment
Closed

LinkedValueUtils:requestOnChange event.target is undefined #4438

sarink opened this issue Jul 20, 2015 · 1 comment

Comments

@sarink
Copy link

sarink commented Jul 20, 2015

On 0.14-beta1, the following example does not work:

    var WithoutMixin = React.createClass({
        getInitialState: function() {
            return {message: 'Hello!'};
        },
        handleChange: function(newValue) {
            this.setState({message: newValue});
        },
        render: function() {
            var valueLink = {
                value: this.state.message,
                requestChange: this.handleChange
            };
            return <input type="text" valueLink={valueLink} />;
        }
    });

The console shows Uncaught TypeError: Cannot read property 'value' of undefined when typing into the input field

fwiw, event.currentTarget seems to be set correctly.

Is there a workaround or fix for this?

Thanks

@zpao
Copy link
Member

zpao commented Jul 20, 2015

This was fixed in #4311 (after beta 1). currentTarget or event.nativeEvent.target should work.

@zpao zpao closed this as completed Jul 20, 2015
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

2 participants