Commit 54a40bf
committed
fix(material/dialog): reserve room for touch targets in scrollable content
`mat-dialog-content` scrolls, and its block-end padding is zero when the dialog has an
actions row. Buttons, checkboxes and radios center a 48px touch target on a 40px control,
and slide toggles center one on a 32px switch, so the target overhangs the control by 4-8px.
An overhanging target at the end of the content is scrollable overflow, so a dialog whose
content ends in one of those controls paints a scrollbar over content that fits.
Reserve the overhang in the block-end padding instead. This keeps the touch targets at their
accessible size, which the alternatives do not: disabling them
(`touch-target-display: none`) shrinks the tap area, and anchoring them so they only overhang
the block-start edge still left 4px of overflow in WebKit in local testing.
Verified with a stock Material app in Chromium, Firefox and WebKit. A dialog with a trailing
checkbox, radio, slide toggle or button goes from 4px, 4px, 8px and 4px of scrollable
overflow respectively to 0 in all three engines. Dialogs with actions grow by 8px, which is
the trade-off for not touching the tap areas.
Fixes #29164.1 parent 5fcd952 commit 54a40bf
2 files changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
194 | 201 | | |
195 | | - | |
| 202 | + | |
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
| |||
0 commit comments