diff --git a/src/ng-datepicker/ng-datepicker.component.ts b/src/ng-datepicker/ng-datepicker.component.ts index 65b80c16e..25dd4fcd5 100644 --- a/src/ng-datepicker/ng-datepicker.component.ts +++ b/src/ng-datepicker/ng-datepicker.component.ts @@ -66,6 +66,11 @@ export class NgDatepickerComponent implements ControlValueAccessor, OnInit, OnCh */ @Input() position = 'bottom-right'; + /** + * inline to keep picker open + */ + @Input() inline = false; + private positions = ['bottom-left', 'bottom-right', 'top-left', 'top-right']; innerValue: Date; @@ -254,11 +259,11 @@ export class NgDatepickerComponent implements ControlValueAccessor, OnInit, OnCh } toggle(): void { - this.isOpened = !this.isOpened; + this.isOpened = !this.isOpened || this.inline; } close(): void { - this.isOpened = false; + this.isOpened = this.inline; } writeValue(val: Date) {