-
Notifications
You must be signed in to change notification settings - Fork 255
Don't change event handling #82
Comments
Great point. @tleunen What do you think? Why did you decide to pass value to handler instead of original event? |
Not sure that it's fired twice because of that though, AFAIK comments don't work like this in JSX. |
Re-writing this comment. Essentially, the problem is that I couldn't stop the handleChange ( checked ) {
// logic
// ...
// ...
this.props.onChange( this.state.checkedCount );
}
render () {
let { title, ...other } = this.props;
return (
<MyComponent { ...other }>
<h1>{ title }</h1>
<Checkbox label='option 1' onChange={ ::this.handleChange } />
</MyComponent>
);
} Use It's hard to reason why: but it's because we trigger it, then the original |
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Sorry for those repeated commits. Don't know if you expect one-commit merges. Had to do some tweaking tweaking with the demos |
If accepted, should probably bump a minor version... As these will be breaking changes |
@web2style once made a PR about the same kind of change: #25. It was accepted and then reverted. But this one seems to be more consistant. It updates every component with the same behavior. Initially, the reason why the value was only sent is because usually, that's the only information you care to receive. But I do understand sometimes you want more, or like in this case, you want the same function signature. So I agree to accept the PR. I'll do it later after a better look at it. |
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Fixes tleunen#82 There are still some components where value, id, name are handled manually.
Then, if I were to switch to use this library,
it breaks.
It fires twice: once with the value, once with the Event.
I would much prefer to have my event handling all work the same: handle the event, let the handler work out what they find useful.
Please change to not intercept the native events.
Same request for Textfield and others.
Thanks for the library, by the way. It's so much easier than using all the mdl classnames
The text was updated successfully, but these errors were encountered: