Skip to content

Add scrollPadding property to DropdownMenu #182890

Closed

Description

@Hamidrzash

Use case

scrollPadding exists as a parameter in TextField and was recently added to
SearchBar (#152635), but DropdownMenu doesn't expose it.

When a DropdownMenu is placed near the bottom of a scrollable view, there is
no way to control how far above the keyboard it scrolls when focused. The inner
TextField uses the default EdgeInsets.all(20.0) with no way to override it.

Current workaround

Manually listening to focus changes and calling Scrollable.ensureVisible
with a custom offset.

Proposal

DropdownMenu should have a scrollPadding parameter that passes through to
its inner TextField, consistent with TextField and SearchBar.

Activity

  1. added
    in triagePresently being triaged by the triage team
    p: material_uimaterial_ui package in flutter/packages
    c: proposalA detailed proposal for a change to Flutter
    team-designOwned by Design Languages team
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Feb 26, 2026
  2. mbcorona commented on Feb 26, 2026

    @mbcorona
    Member

    Hi @Hamidrzash, thanks for the proposal and for opening a PR, im labeling team-design to review the addition of scrollPadding to DropdownMenu

  3. ishaquehassan commented on Feb 27, 2026

    @ishaquehassan
    Contributor

    Agreed — this is a straightforward consistency gap. Both TextField and SearchBar expose scrollPadding, and since DropdownMenu wraps a TextField internally, it should forward this parameter.

    Implementation path:

    1. Add scrollPadding parameter to DropdownMenu with the same default as TextField (EdgeInsets.all(20.0)):
    const DropdownMenu({
      // ...existing params...
      this.scrollPadding = const EdgeInsets.all(20.0),
    });
    1. Forward it to the internal TextField inside DropdownMenu's build method:
    TextField(
      // ...existing args...
      scrollPadding: scrollPadding,
    )

    This mirrors exactly how SearchBar added the same parameter in #152635. The change is minimal and non-breaking since the default preserves existing behavior.

  4. added a commit that references this issue on Mar 2, 2026
    ae58c4f
  5. added
    P3Issues that are less important to the Flutter project
    triaged-designTriaged by Design Languages team
    on Mar 4, 2026
  6. Hamidrzash commented on Mar 24, 2026

    @Hamidrzash
    Author

    Hi Flutter team! I opened issue #182890 and also submitted a fix in #182892 on the same day. I noticed #183109 was opened a week later and ended up being merged. I'd love to understand what differences led to choosing that PR over mine, so I can better align with Flutter's expectations in future contributions. Thanks!

    @dkwingsmt

  7. Hamidrzash commented on Mar 24, 2026

    @Hamidrzash
    Author

    The merged PR #183109 covers DropdownMenu, but DropdownMenuFormField still doesn't expose scrollPadding. I'm opening a follow-up PR to address that remaining gap. #184059

  8. dkwingsmt commented on Apr 1, 2026

    @dkwingsmt
    Contributor

    Hi @Hamidrzash! I am really, really sorry about the situation and I want to assure you that this was by no means intentional. To give you some context, we receive a large volume of PRs each week. While reviewers (like myself) typically check our backlog on a weekly basis, sometimes a PR can slip through the cracks. This likely happened because I've been reviewing PRs from oldest to newest lately, and unfortunately, I missed yours. I sincerely appreciate all your efforts. Contributions and fixes like yours are exactly what keeps Flutter running and improving! We truly value your time and work.

  9. Hamidrzash commented on Apr 5, 2026

    @Hamidrzash
    Author

    Thanks for taking the time to explain, I really appreciate it! No worries at all.. I totally understand how busy things can get. Looking forward to contributing more!

  10. github-actions commented on Apr 19, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions