Bug description:
Popup datepicker with custom date picking function closes automatically after value select even with preventing event from propagation etc. I think there should be an option to prevent closing datepicker on date select (e.g. if I want to implement range datepicker in popup its problematic).
Link to minimally-working plunker that reproduces the issue:
http://plnkr.co/edit/McF4tVd9D2fXNNx9QQxe?p=preview
Version of Angular, ng-bootstrap, and Bootstrap:
Angular: 4.1.3
ng-bootstrap: 1.0.0-beta.2
Bootstrap: 4.0.0-beta
The least invasive solution would seem to be to add a flag to the API (ex:
autoClose: default true
) and wrap the current ref listener as such:This would keep backwards compatibility intact and allow users to control when the popup is closed when needed.
Just wanted to add a very simple example of the implementing code:
Could anybody please review the changes in #2192?
You can call
d.close()
whenever necessary.P.S. I’ll also introduce the
(dateSelect)
event to avoid using(ngModelChange)
after this one is merged. It’s already present in the non-input datepicker.