单击时的日历问题

时间:2018-12-12 10:39:01

标签: javascript node.js reactjs datepicker

日期选择器未在我的应用中打开。请你帮助我好吗?当我单击时,正在执行openCalendar函数,但日期选择器根本没有打开。

openCalendar = e => {
e.preventDefault();
e.stopPropagation();
this._calendar.setOpen(true);

console.log(this._calendar);
};

我有此代码作为回报{

          {/* DATEPICKER */}
      <div className={cx(s.dtpicker, step ? overlay.legField : null)} ref={el => (this.dtpicker = el)}>
        <div className={s.dateClicker} onClick={this.openCalendar} />
        <Calendar color="#A8AAB7" />

        <DatePicker
          ref={c => (this._calendar = c)}
          selected={leg.date || this.getToday()}
          onChange={(d) => this.updateDate(d, index)}
          minDate={this.today}
          autoFocus={false}
          readOnly={true}

          /*open={true}*/

          shouldCloseOnSelect={false}
          locale={currentLocale}
          showTimeSelect
          timeFormat="HH:mm"
          timeIntervals={30}
          dateFormat="ddd, DD MMM YYYY HH:mm"
          popperPlacement="bottom-center"
          popperModifiers={{
            preventOverflow: {
              enabled: true,
              escapeWithReference: false, // force popper to stay in viewport (even when input is scrolled out of view)
              boundariesElement: 'viewport'
            }
          }}
        />

      </div>

如果需要解决此问题,我可以提供更多详细信息。

提前谢谢!

0 个答案:

没有答案