Skip to content

Commit d87b1d7

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/select/select.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,9 @@ export class MatSelect extends _MatSelectMixinBase implements AfterContentInit,
360360
this._multiple = coerceBooleanProperty(value);
361361
}
362362

363+
/** Whether the user wants to disable the offset. */
364+
@Input () disableOffset: string = '';
365+
363366
/**
364367
* A function to compare the option values with the selected values. The first argument
365368
* is a value from an option. The second is a value from the selection. A boolean
@@ -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)