How to recognize if User chose data by either pressing "Enter" button or by mouse click?
Below is my code:
<SingleDatePicker
date={this.state.date}
isOutsideRange={() => false}
isDayHighlighted={day => isSameDay(moment(new Date()),moment(day))}
daySize={30}
verticalSpacing={2}
onDateChange={date => {
this.setState({ date });
if(date) {
this.props.onSaveValue(date.unix());
}
}}
displayFormat={this.props.dateFormat}
focused={this.state.focused}
numberOfMonths={1}
placeholder={this.props.dateFormat}
onFocusChange={({ focused }) =>{
this.setState({ focused });
this.props.isCalendarOpen(focused)
}}
/>
I have simple SingleDatePicker
and I didn't find some way to recognize how User chose data, without addeventlisener
and other listeners.