Skip to content

Commit 0f6d17b

Browse files
committed
Apply suggested wording for the menu scrollbar comment
1 parent bdc4cc4 commit 0f6d17b

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎packages/material_ui/lib/src/menu_anchor.dart‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3697,13 +3697,11 @@ class _MenuPanelState extends State<_MenuPanel> {
36973697
final EdgeInsetsGeometry padding =
36983698
resolve<EdgeInsetsGeometry?>((MenuStyle? style) => style?.padding) ?? EdgeInsets.zero;
36993699
final Offset densityAdjustment = visualDensity.baseSizeAdjustment;
3700-
// Material's Scrollbar uses the ambient MediaQuery padding as its painter
3701-
// padding when no explicit padding is given, so that the thumb clears
3702-
// system intrusions such as a gesture bar. The menu overlay is already
3703-
// positioned inside the safe area, so honoring that padding a second time
3704-
// shortens the scrollbar track and stops the thumb from reaching the end of
3705-
// the menu. The padding is therefore removed for the Scrollbar only and
3706-
// restored below it, so menu children keep observing the ambient values.
3700+
// Scrollbar uses the `MediaQuery.padding` as its painter padding by
3701+
// default. Menu overlays are already positioned within the safe area, so
3702+
// applying that padding again shortens the scrollbar track and stops the
3703+
// thumb from reaching the end of the menu. Remove the padding only for the
3704+
// Scrollbar and restore the ambient MediaQuery for menu children.
37073705
final MediaQueryData ambientMediaQuery = MediaQuery.of(context);
37083706
final MediaQueryData scrollbarMediaQuery = ambientMediaQuery.removePadding(
37093707
removeLeft: true,

0 commit comments

Comments
 (0)