It would be nice if the datepicker input provided an @Output
event to be emitted when the calendar popup is closed. I can provide a PR if you think you might merge that.
The reason is that I use the DatePicker input as readonly, and open the calendar popup on click. However, the input obviously blurs when that opens, and I would like my component that wraps the datepicker input to blur when the calendar popup is closed.
Is this something you are interested in?
Yes, that’s clearly something that’s missing, just a couple of thoughts.
I would add closing prevention, as it might provide a workaround for some of the custom
[autoClose]
-related issues.I think I’d suggest something like this for an API (just some ideas for discussion):
Usage:
For the implementation, there is already a private
Subject
for internal notification on close: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/datepicker/datepicker-input.ts#L65I guess the event emitter should trigger it unless the event was prevented.