Skip to content

[material_ui] Fix DropdownMenuFormField missing leading icon - #12759

Open
haashem wants to merge 2 commits into
flutter:mainfrom
haashem:fix-185445-dropdown-menu-leading-icon
Open

[material_ui] Fix DropdownMenuFormField missing leading icon#12759
haashem wants to merge 2 commits into
flutter:mainfrom
haashem:fix-185445-dropdown-menu-leading-icon

Conversation

@haashem

@haashem haashem commented Sep 4, 2026

Copy link
Copy Markdown

Fixes a regression where DropdownMenuFormField.leadingIcon was not shown in the field.

DropdownMenuFormField took a leadingIcon, but didn’t actually show it in the field. This change makes it behave like trailingIcon, so the leading icon now shows up as the default prefix icon.

Fixes flutter/flutter#185416

With only leadingIcon
image

decorationBuilder has higher priority than leading icon.
image

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

Apply the leadingIcon fallback for custom decorations, add regression coverage, and record the patch release changelog.
@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Sep 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request ensures that DropdownMenuFormField.leadingIcon is displayed in the text field by assigning it as the prefix icon when InputDecoration.prefixIcon is null. It also adds documentation and a widget test to verify this behavior. The feedback suggests optimizing performance by checking if widget.leadingIcon is non-null before calling copyWith to avoid unnecessary InputDecoration allocations.

Comment thread packages/material_ui/lib/src/dropdown_menu.dart Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DropdownMenuFormField Missing Leading Icon

1 participant