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