React-calendar: Need unSelect or onBlur

Created on 8 Apr 2018  路  2Comments  路  Source: wojtekmaj/react-calendar

Hello, I'm using your calendar to filter a list of events based on which day is selected. However, I need a way to show all events again when the day is unselected or the calendar is blurred. Is there a way to do this?

Thank you!

question

Most helpful comment

Hey there! I'm on mobile at the moment but here's what comes from the top of my head.

There are callbacks like onClickDay. You could detect that selected day has been clicked and clear the chosen value on your side.
For blur, I'd suggest listening on document body and check if . react-calendar contains event.target. if not, user clicked away.

Hope this helps!

All 2 comments

Hey there! I'm on mobile at the moment but here's what comes from the top of my head.

There are callbacks like onClickDay. You could detect that selected day has been clicked and clear the chosen value on your side.
For blur, I'd suggest listening on document body and check if . react-calendar contains event.target. if not, user clicked away.

Hope this helps!

I'm closing this issue to give other issues more visibility. If you still need assistance with this matter, please do not hesitate to reply and I'll reopen.

Happy coding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dumkanki picture dumkanki  路  3Comments

akhilaudable picture akhilaudable  路  3Comments

fasmart4 picture fasmart4  路  6Comments

tranvula picture tranvula  路  4Comments

rmccue picture rmccue  路  4Comments