Closed treeskar closed 4 years ago
Hi @ludmilanesvitiy, The problem is, that isOpen setter calls to show method instantly without waiting to custom configuration or other inputs to come.
set isOpen(value: boolean) {
if (value) {
this.show();
} else {
this.hide();
}
}
BTW if "bsConfig" input would change when "datepicker" is open, this change wouldn't affect to component at all.
I recommend from isOpen setter emit event only, then create a stream, that will aggregate all necessary data, will deal with all dependencies and call show/hide method with right timing and when it needed. For example first time has to be after component's view initiated and all inputs got their values.
set isOpen(value: boolean) {
this._isOpen$.next(value)
}
If you are welcome contribution, I'd like create a pull request with fix that I described. Thanks.
@treeskar If you could create PR with a fix, it'll be super awesome. Thank you!
Bug description or feature request:
bsDatepicker component ignores bsConfig if isOpen is true
If I close and open datepicker the configuration applied correctly.
Plunker/StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-c1pmag
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 3.2.0
Angular: 7.2.2
Bootstrap: 4.2.1
Build system: Angular CLI