So I think this can be discussed, but it seems to make sense for the DayPicker to hide on escape press. However, DayPicker visibility is intrinsically tied to focus right now which is maybe not what we want.
So one option we could do is just to blur the input on escape. The better option, I think, would be to decouple visibility from focus, such that the focus state remains when you hit escape, but the DayPicker would close. This begs the question of how you would reopen it from this state... arrow down maybe? I am not sure right now.
I think that until we have a way to reopen it from "focused + closed", escape should always blur the focus, and that once we have that way, we'd want an option to control whether escape blurs the focus or not.
Separately, down arrow makes sense to me as a way to open the datepicker in that scenario.
How can we close the SingleDateSelector programmatically?
Same question with @fullhdpixel
I just submitted a PR that closes the DayPicker when the input has focus and the escape key is pressed.
It looks like this PR has addressed this? I'm going to close this but if I'm mistaken please feel free to reopen!
Actually I'm going to reopen this as it doesn't seem to be working.
Most helpful comment
How can we close the SingleDateSelector programmatically?