React-date-picker: Add onFocus & onBlur events

Created on 19 Apr 2018  路  4Comments  路  Source: wojtekmaj/react-date-picker

We are using react-date-picker (love it) in combination with react-redux-forms. In order to make it play right with validation we need to hook into the onClick (focus) and click outside the component (blur).

Passing onClick to the component does nothing - just gets ignored.

recreate:
<DatePicker onClick={() => console.log('hello')} />; // never fires.

Do you know a potential workaround for this?

enhancement

Most helpful comment

Starting with v6.13.0, you are able to do this.

All 4 comments

Hmmm. That seems like an excellent idea! My main concern is how to handle this nicely taking into consideration that DatePicker renders DateInput and Calendar components, both potentially supporting a number of events. I could catch all the events that bubbled up to DatePicker, but is it an optimal solution?

We were concerned with the actual text input itself, not the DateInput or Calendar components.

so will you add events? this is crucial

Starting with v6.13.0, you are able to do this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

allys00 picture allys00  路  4Comments

wojtekmaj picture wojtekmaj  路  7Comments

aladinflux picture aladinflux  路  3Comments

leo-iomer picture leo-iomer  路  8Comments

cavishek39 picture cavishek39  路  3Comments