From 1234b0cce2527520e79954876ab9caaee54f6237 Mon Sep 17 00:00:00 2001 From: Yoni Farin Date: Sun, 7 Jan 2018 01:25:10 +0200 Subject: [PATCH] Inline support --- src/ng-datepicker/ng-datepicker.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) {