Skip to content

Commit d8e860f

Browse files
committed
fix(cdk/a11y): visually hidden element affecting scrolling
We had a `position: absolute` on the visually-hidden element, but it didn't have an actual position which can cause unnecessary scrolling in some cases. Fixes #24597.
1 parent f8dadb3 commit d8e860f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cdk/a11y/_index.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
// Avoid some cases where the browser will still render the native controls (see #9049).
2222
-webkit-appearance: none;
2323
-moz-appearance: none;
24+
25+
// We need at least one of top/bottom/left/right in order to prevent cases where the
26+
// absolute-positioned element is pushed down and can affect scrolling (see #24597).
27+
// `left` was chosen here, because it's the least likely to break overrides where the
28+
// element might have been positioned (e.g. `mat-checkbox`).
29+
left: 1px;
2430
}
2531
}
2632

0 commit comments

Comments
 (0)