T
T
tj572018-12-09 14:32:07
JavaScript
tj57, 2018-12-09 14:32:07

How to close the moment.js calendar widget after a date is selected?

I've added a moment.js calendar component to pick the date. SingleDatePicker Component

import moment from 'moment';
import {SingleDatePicker} from 'react-dates';
...
render() {
   return (
  <SingleDatePicker
            date={this.state.createdAt}
            onDateChange={this.onDateChange}
            focused={this.state.calendarFocused}
            onFocusChange={this.onFocusChange}
            numberOfMonths={1}
            isOutsideRange={() => false}
          />
 );
 }

5c0cfd0e20d2e633621831.png5c0cfd17e93c3241358137.png
When I open the calendar and select a date, it doesn't close when I press Esc. The faq of the widget states that it should be closed. What could be the problem ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question