Closed lik2016 closed 8 years ago
Hi there, that is correct, the widgets don't support native form validation, because not all of the widgets even have inputs that can be validated (dropdown, multiselect, etc). In general native validation with react is just going to be a bad time, my suggestion is to use a form library like react-formal, or redux-form (if you are using redux) which handle all the concerns, edge cases, and complexity of form validation
Adding just one-line of code in DateTimePicker.js will make your widget have this feature. Add the following in _react2.default.createElement (after line 306). required: _props.required, Would you mind making this change?
I don't want to make the change because then the widget suite would inconsistently sort-of support this. Since its not possible to have good or even "ok" support for native form validation for the inputs I'd rather not pretend that its supported, instead it makes more sense to use a proper form validation library.
understood. I have another question unrelated to this issue. .babelrc has preset "jason". I am getting errors with this preset? Would you change to like 'es2015'? Thanks.
the babel preset is just a personal collection of presets, it essentailly es2015. it shouldn't throw errors as its related to the build process, it shouldn't effect you consumption of the library. if so then its a problem lower down with one of the packages, try uninstalling and reinstalling
I am having a need to make some date pickers as a required field in a form, but the required attribute is not handled.
<DateTimePicker defaultVaule={null} required="required" footer={false} format="MM/DD/YYYY" time={false} onChange={this._onDateChange.bind(this, 'invoice')} />