Skip to content

Commit d1d85b2

Browse files
committed
fix(material/paginator): added transparent element for larger touch target
added transparent touch target element on top of paginator select to get touch target to 48 pixel height Fixes b/225394124
1 parent f98f733 commit d1d85b2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/material/paginator/paginator.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
[color]="color"
1313
class="mat-mdc-paginator-page-size-select">
1414
<mat-select
15+
#selectRef
1516
[value]="pageSize"
1617
[disabled]="disabled"
1718
[aria-labelledby]="_pageSizeLabelId"
@@ -25,6 +26,7 @@
2526
</mat-option>
2627
}
2728
</mat-select>
29+
<div class="mat-mdc-paginator-touch-target" (click)="selectRef.open()"></div>
2830
</mat-form-field>
2931
}
3032

src/material/paginator/paginator.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $page-size-margin-right: 8px;
99
$items-per-page-label-margin: 0 4px;
1010
$selector-margin: 0 4px;
1111
$selector-trigger-width: 84px;
12+
$touch-target-height: 48px;
1213

1314
$range-label-margin: 0 32px 0 24px;
1415
$button-icon-size: 28px;
@@ -47,7 +48,7 @@ $button-icon-size: 28px;
4748
.mat-mdc-select {
4849
// The smaller font size inherited from the paginator throws off the centering of the select
4950
// inside the form field. This `line-height` helps to center it relative to the other text.
50-
line-height: 2;
51+
line-height: 1.5;
5152
}
5253
}
5354

@@ -133,3 +134,14 @@ $button-icon-size: 28px;
133134
outline: solid 1px;
134135
}
135136
}
137+
138+
.mat-mdc-paginator-touch-target {
139+
position: absolute;
140+
top: 50%;
141+
left: 50%;
142+
width: $selector-trigger-width;
143+
height: $touch-target-height;
144+
background-color: transparent;
145+
transform: translate(-50%, -50%);
146+
cursor: pointer;
147+
}

0 commit comments

Comments
 (0)