Skip to content

Commit d8bee8e

Browse files
mschoudrypkozlowski-opensource
authored andcommitted
feat(datepicker): add support for placement "auto"
Closes #1257 Closes #1820
1 parent a053819 commit d8bee8e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/datepicker/datepicker-input.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {NgbDatepicker, NgbDatepickerNavigateEvent} from './datepicker';
2222
import {DayTemplateContext} from './datepicker-day-template-context';
2323
import {NgbDateParserFormatter} from './ngb-date-parser-formatter';
2424

25-
import {positionElements} from '../util/positioning';
25+
import {positionElements, PlacementArray} from '../util/positioning';
2626
import {NgbDateStruct} from './ngb-date-struct';
2727
import {NgbCalendar} from './ngb-calendar';
2828
import {NgbDatepickerService} from './datepicker-service';
@@ -103,12 +103,13 @@ export class NgbInputDatepicker implements OnChanges,
103103
*/
104104
@Input() outsideDays: 'visible' | 'collapsed' | 'hidden';
105105

106-
107106
/**
108-
* Placement of a datepicker popup. Accepts: "top", "bottom", "left", "right", "bottom-left",
109-
* "bottom-right" etc.
110-
*/
111-
@Input() placement = 'bottom-left';
107+
* Placement of a datepicker popup accepts:
108+
* "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right",
109+
* "left", "left-top", "left-bottom", "right", "right-top", "right-bottom"
110+
* and array of above values.
111+
*/
112+
@Input() placement: PlacementArray = 'bottom-left';
112113

113114
/**
114115
* Whether to display days of the week

0 commit comments

Comments
 (0)