Date-Picker组件不在React-js中处理模态

时间:2015-07-09 14:59:22

标签: reactjs

我在react-js中的模态上使用material-ui日期选择器组件(http://material-ui.com/#/components/date-picker)。当我在日历中选择特定日期时,页面会重新加载而不是选择日期。我认为模态事件超过了日期选择器事件。我想在模态事件上覆盖日期选择器事件。什么是最好的解决方案? 在此先感谢.. :))

1 个答案:

答案 0 :(得分:-1)

<DatePicker {...baseProps} hintText="Choose Date" mode="portrait" className = {"datePicker"}/> There was a <form> element, in which this date-picker is defined, the form was returning false on any button click( onSubmit ), so date-picker buttons were returning false on click. I made a change to <form> element. <form className="form" onSubmit={() => false}> So, this solved my problem.