Skip to content

Commit 0c8bfb7

Browse files
committed
fix(select):update implementation to use component input
1 parent c25862a commit 0c8bfb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/select/select.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export class MatSelectTrigger {}
184184
exportAs: 'matSelect',
185185
templateUrl: 'select.html',
186186
styleUrls: ['select.css'],
187-
inputs: ['disabled', 'disableRipple', 'tabIndex'],
187+
inputs: ['disabled', 'disableRipple', 'tabIndex', 'disbaleOffset'],
188188
encapsulation: ViewEncapsulation.None,
189189
preserveWhitespaces: false,
190190
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -359,6 +359,9 @@ export class MatSelect extends _MatSelectMixinBase implements AfterContentInit,
359359

360360
this._multiple = coerceBooleanProperty(value);
361361
}
362+
363+
/** Whether the user wants to disable the offset. */
364+
@Input () disableOffset: string = "";
362365

363366
/**
364367
* A function to compare the option values with the selected values. The first argument
@@ -1120,7 +1123,7 @@ export class MatSelect extends _MatSelectMixinBase implements AfterContentInit,
11201123
let optionOffsetFromPanelTop: number;
11211124

11221125
// Disable offset for smaller lists by returning 0 as value to offset
1123-
if (this._getItemCount() <= maxOptionsDisplayed) {
1126+
if (this.disableOffset == 'true') {
11241127
return 0;
11251128
}
11261129

0 commit comments

Comments
 (0)