@@ -134,6 +134,43 @@ export class DropdownComponent implements AfterContentInit, OnDestroy, OnInit {
134134 }
135135 private _popper = true ;
136136
137+ /**
138+ * Optional popper Options object, placement prop takes precedence over
139+ * @type Partial<Options>
140+ */
141+ @Input ( )
142+ set popperOptions ( value : Partial < Options > ) {
143+ this . _popperOptions = { ...this . _popperOptions , ...value } ;
144+ } ;
145+ get popperOptions ( ) : Partial < Options > {
146+ let placement = this . placement ;
147+ switch ( this . direction ) {
148+ case 'dropup' : {
149+ placement = 'top-start' ;
150+ break ;
151+ }
152+ case 'dropend' : {
153+ placement = 'right-start' ;
154+ break ;
155+ }
156+ case 'dropstart' : {
157+ placement = 'left-start' ;
158+ break ;
159+ }
160+ }
161+ if ( this . alignment === 'end' ) {
162+ placement = 'bottom-end' ;
163+ }
164+ this . _popperOptions = { ...this . _popperOptions , placement : placement } ;
165+ return this . _popperOptions ;
166+ }
167+
168+ private _popperOptions : Partial < Options > = {
169+ placement : this . placement ,
170+ modifiers : [ ] ,
171+ strategy : 'absolute'
172+ } ;
173+
137174 /**
138175 * Set the dropdown variant to an btn-group, dropdown, input-group, and nav-item.
139176 */
@@ -198,35 +235,6 @@ export class DropdownComponent implements AfterContentInit, OnDestroy, OnInit {
198235 return this . variant === 'input-group' ? { display : 'contents' } : { } ;
199236 }
200237
201- private _popperOptions : Options = {
202- placement : this . placement ,
203- modifiers : [ ] ,
204- strategy : 'absolute' ,
205- } ;
206-
207- private get popperOptions ( ) : Options {
208- let placement = this . placement ;
209- switch ( this . direction ) {
210- case 'dropup' : {
211- placement = 'top-start' ;
212- break ;
213- }
214- case 'dropend' : {
215- placement = 'right-start' ;
216- break ;
217- }
218- case 'dropstart' : {
219- placement = 'left-start' ;
220- break ;
221- }
222- }
223- if ( this . alignment === 'end' ) {
224- placement = 'bottom-end' ;
225- }
226- this . _popperOptions = { ...this . _popperOptions , placement : placement } ;
227- return this . _popperOptions ;
228- }
229-
230238 dropdownStateSubscribe ( subscribe : boolean = true ) : void {
231239 if ( subscribe ) {
232240 this . dropdownStateSubscription =
0 commit comments