Skip to content

Commit

Permalink
fix(paginator): page size selector not working
Browse files Browse the repository at this point in the history
* Fixes the page size selection stretching to 100% of the paginator.
* Fixes the `MdFormFieldModule` not being imported by `md-select`, causing it to look wrong.
  • Loading branch information
crisbeto committed Sep 22, 2017
1 parent 3571f68 commit dc23b90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/lib/paginator/paginator.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
{{_intl.itemsPerPageLabel}}
</div>

<mat-form-field *ngIf="_displayedPageSizeOptions.length > 1">
<mat-select class="mat-paginator-page-size-select"
[value]="pageSize"
[aria-label]="_intl.itemsPerPageLabel"
(change)="_changePageSize($event.value)">
<mat-form-field
*ngIf="_displayedPageSizeOptions.length > 1"
class="mat-paginator-page-size-select">
<mat-select
[value]="pageSize"
[aria-label]="_intl.itemsPerPageLabel"
(change)="_changePageSize($event.value)">
<mat-option *ngFor="let pageSizeOption of _displayedPageSizeOptions" [value]="pageSizeOption">
{{pageSizeOption}}
</mat-option>
Expand Down
7 changes: 1 addition & 6 deletions src/lib/paginator/paginator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,8 @@ $mat-paginator-button-increment-icon-margin: 16px;
}

.mat-paginator-page-size-select {
// Since the select won't have a placeholder we can remove the space that is reserved for it.
padding-top: 0;
margin: $mat-paginator-selector-margin;

.mat-select-trigger {
min-width: $mat-paginator-selector-trigger-min-width;
}
width: $mat-paginator-selector-trigger-min-width;
}

.mat-paginator-range-label {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/select/select-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {CommonModule} from '@angular/common';
import {MdSelect, MdSelectTrigger, MD_SELECT_SCROLL_STRATEGY_PROVIDER} from './select';
import {MdCommonModule, MdOptionModule} from '@angular/material/core';
import {OverlayModule} from '@angular/cdk/overlay';
import {MdFormFieldModule} from '@angular/material/form-field';


@NgModule({
Expand All @@ -20,7 +21,7 @@ import {OverlayModule} from '@angular/cdk/overlay';
MdOptionModule,
MdCommonModule,
],
exports: [MdSelect, MdSelectTrigger, MdOptionModule, MdCommonModule],
exports: [MdFormFieldModule, MdSelect, MdSelectTrigger, MdOptionModule, MdCommonModule],
declarations: [MdSelect, MdSelectTrigger],
providers: [MD_SELECT_SCROLL_STRATEGY_PROVIDER]
})
Expand Down

0 comments on commit dc23b90

Please sign in to comment.