Redux-form-material-ui: DatePicker: onChange prop on Field not firing

Created on 1 Dec 2016  路  5Comments  路  Source: erikras/redux-form-material-ui

I cannot get the onChange function on the Field Component to fire.

Example component:

import React from 'react';
import { Field } from 'redux-form';
import {DatePicker} from 'redux-form-material-ui';

class DatepickerInput extends React.Component{
    constructor() {
      super();
      this._handleChange = this._handleChange.bind(this);
    }

    _handleChange(e, v) {
      console.log('Handle datepicker change');
    }

    render() {
      return (
        <Field component={DatePicker}
          name={this.props.name}
          onChange={this._handleChange}
          format={(v) => ((v !== '') ?  v : null)}
        />
      );
    }
};
export default DatepickerInput;

Most helpful comment

Hey, I had this issue in the latest version.
I was able to make it work by using the autoOk={true} option, I don't really know why but it worked for me

All 5 comments

did you find a workaround for this? im having the same issue.

nevermind it's fixed in latest version, should close.

Hey, I had this issue in the latest version.
I was able to make it work by using the autoOk={true} option, I don't really know why but it worked for me

closing as it is solved with latest version.

thanks @kevteg using the current version and it did not work, but with autoOk={true} it does.

Was this page helpful?
0 / 5 - 0 ratings