Closed wzsxyz closed 7 years ago
@wzsxyz 不知道你是怎么使用的,发下你的用例
http://test1.npm.yijifu.net/__build/demo.html
js代码:
/**
var React = require('react'); var ReactDom = require('react-dom');
var RMDatePicker = require('react-mobile-datepicker');
var DatePicker = React.createClass({ getInitialState: function(){ return { isOpen: false, time: new Date(), value: '' } }, componentDidMount: function(){ var _this = this; $('body').on('click', '.datepicker-modal', function(){ _this.setState({ isOpen: false }); }) }, render: function(){ var _this = this; return (
)
}
});
ReactDom.render(<DatePicker
/>, $('.js-date')[0]);
@wzsxyz https://codepen.io/lanjingling0510/pen/yXdoNB 关闭datepicker-modal直接在onSelect回调里控制
onSelect事件中获取的参数是永远是初始时的时间,这导致组件完全失去意义。这bug也太夸张了吧?