Skip to content

[material_ui] DropdownButtonFormField: InputDecoration looks enabled and reacts to hover when enabled: false #195192

Closed
flutter/packages
#13473

Description

@JannikWinter

What package does this bug report belong to?

material_ui

What target platforms are you seeing this bug on?

Windows

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
  characters:
    dependency: transitive
    description:
      name: characters
      sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
      url: "https://pub.dev"
    source: hosted
    version: "1.4.1"
  clock:
    dependency: transitive
    description:
      name: clock
      sha256: e51d50bca3217c9a9fa2b41a30e4a38971133f5f9ec7a3d57bae095007f1d28e
      url: "https://pub.dev"
    source: hosted
    version: "1.1.3"
  collection:
    dependency: transitive
    description:
      name: collection
      sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
      url: "https://pub.dev"
    source: hosted
    version: "1.19.1"
  cupertino_ui:
    dependency: transitive
    description:
      name: cupertino_ui
      sha256: a47c4e7c66fd7444a063a602597fceb238f705c3f6b1322bc0053d0a2638ee6e
      url: "https://pub.dev"
    source: hosted
    version: "1.1.4"
  flutter:
    dependency: "direct main"
    description: flutter
    source: sdk
    version: "0.0.0"
  flutter_lints:
    dependency: "direct dev"
    description:
      name: flutter_lints
      sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
      url: "https://pub.dev"
    source: hosted
    version: "6.0.0"
  flutter_localizations:
    dependency: transitive
    description: flutter
    source: sdk
    version: "0.0.0"
  intl:
    dependency: transitive
    description:
      name: intl
      sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867"
      url: "https://pub.dev"
    source: hosted
    version: "0.20.3"
  lints:
    dependency: transitive
    description:
      name: lints
      sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
      url: "https://pub.dev"
    source: hosted
    version: "6.1.0"
  listen:
    dependency: transitive
    description:
      name: listen
      sha256: "47501a08016a43fcad79252439d723f50f14f88fa7bfd8a177e0a417e5c9e1f2"
      url: "https://pub.dev"
    source: hosted
    version: "1.0.1"
  material_color_utilities:
    dependency: transitive
    description:
      name: material_color_utilities
      sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
      url: "https://pub.dev"
    source: hosted
    version: "0.13.0"
  material_ui:
    dependency: "direct main"
    description:
      name: material_ui
      sha256: e4031746f96c8316864d9b92bce375f1320a36ed56e166307e1e1bda9d90b4ab
      url: "https://pub.dev"
    source: hosted
    version: "1.8.0"
  meta:
    dependency: transitive
    description:
      name: meta
      sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
      url: "https://pub.dev"
    source: hosted
    version: "1.19.0"
  path:
    dependency: transitive
    description:
      name: path
      sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
      url: "https://pub.dev"
    source: hosted
    version: "1.9.1"
  sky_engine:
    dependency: transitive
    description: flutter
    source: sdk
    version: "0.0.0"
  vector_math:
    dependency: transitive
    description:
      name: vector_math
      sha256: "92b9910f66ed1057fd4da7b040ae7c74cafacf885bdc81be496928d5049b032d"
      url: "https://pub.dev"
    source: hosted
    version: "2.4.3"
sdks:
  dart: ">=3.14.0-315.3.beta <4.0.0"
  flutter: ">=3.47.0"

Steps to reproduce

Use a DropdownMenuFormField and either:

  • Set its enabled property to false

or

  • Set its enabled and onChanged properties to null (legacy, before enabled got introduced in PR#12610)

Expected results

  1. The interaction with the FormField should be disabled and you should not be able to select any item - works as expected ✅
  2. The InputDecoration should go into its disabled state (the same way TextFormField's InputDecoration does when setting enabled to false) - does not work as expected ❌

Actual results

The InputDecoration stays enabled and reacts to hovering.
It looks like the field is still active, event though it is disabled.

Code sample

Code sample
import 'package:material_ui/material_ui.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example',
      theme: ThemeData.dark(),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool fieldsEnabled = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(32.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Row(
                children: [
                  Text("Fields enabled: "),
                  Switch(
                    value: fieldsEnabled,
                    onChanged: (value) {
                      setState(() {
                        fieldsEnabled = !fieldsEnabled;
                      });
                    },
                  ),
                ],
              ),
              Row(
                children: [
                  Text("DropdownButtonFormField: "),
                  Expanded(
                    child: DropdownButtonFormField<int>(
                      enabled: fieldsEnabled,
                      items: [
                        DropdownMenuItem(value: 1, child: Text("Menu Item")),
                      ],
                    ),
                  ),
                ],
              ),
              Row(
                children: [
                  Text("TextFormField: "),
                  Expanded(child: TextFormField(enabled: fieldsEnabled)),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Videos

Screenshots / Video demonstration Image

Logs

No response

Flutter Doctor output

Doctor output
$ flutter doctor -v
[√] Flutter (Channel beta, 3.50.0-0.2.pre, on Microsoft Windows [Version 10.0.26200.9711], locale de-DE) [281ms]
    • Flutter version 3.50.0-0.2.pre on channel beta at D:\dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9c0b99ee21 (17 hours ago), 2026-10-22 21:34:18 -0700
    • Engine revision c59629b701
    • Dart version 3.14.0 (build 3.14.0-315.3.beta)
    • DevTools version 2.61.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration,
      enable-hcpp

[√] Windows Version (Windows 11 or higher, 25H2, 2009) [1.801ms]

[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1.577ms]
    • Android SDK at D:/dev/Android/sdk
    • Emulator version 35.5.10.0 (build_id 13402964) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: D:\Programme\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
    • All Android licenses accepted.

[√] Chrome - develop for the web [72ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.4.0) [71ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
    • Visual Studio Community 2026 version 18.4.11605.240
    • Windows 10 SDK version 10.0.26100.0

[√] Connected device (3 available) [351ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26200.9711]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 146.0.7680.72
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 141.0.3537.99 (unsupported)

[√] Network resources [345ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. changed the title [-]DropdownMenuFormField's InputDecoration does not respect the enabled state the same way TextFormField does[/-] [+]DropdownButtonFormField: InputDecoration looks enabled and reacts to hover when enabled: false[/+] on Oct 24, 2026
  2. puneetkukreja98 commented on Oct 26, 2026

    @puneetkukreja98
    Contributor

    @JannikWinter Thanks for reporting this issue, I was able to reproduce it on web as well, so it isn't specific to windows.
    Findings:
    material_ui: ^1.8.0

    flutter doctor -v:

    [✓] Flutter (Channel master, 3.50.0-1.0.pre-232, on macOS 26.4.1 25E253
        darwin-arm64, locale en-US) [5.7s]
        • Flutter version 3.50.0-1.0.pre-232 on channel master at
          /Users/puneetkukreja/flutter-contribution/flutter
        • Upstream repository https://github.com/puneetkukreja98/flutter
        • FLUTTER_GIT_URL = https://github.com/puneetkukreja98/flutter
        • Framework revision 66b3ad9017 (26 hours ago), 2026-10-25 03:58:21 +0000
        • Engine revision 66b3ad9017
        • Dart version 3.15.0 (build 3.15.0-72.0.dev)
        • DevTools version 2.61.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop,
          enable-windows-desktop, enable-android, enable-ios, cli-animations,
          enable-native-assets, enable-record-use, enable-swift-package-manager,
          omit-legacy-version-file, enable-windowing, enable-lldb-debugging,
          enable-uiscene-migration, enable-riscv64, enable-hcpp
    
    [✓] Android toolchain - develop for Android devices (Android SDK version
        37.0.0-rc1) [6.8s]
        • Android SDK at /Users/puneetkukreja/Library/Android/sdk
        • Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
        • Platform android-37.1, build-tools 37.0.0-rc1
        • Java binary at:
          /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/java
          This JDK is specified in your Flutter configuration.
          To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 26.6) [5.9s]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 17F113
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web [11ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Connected device (3 available) [8.4s]
        • Puneet’s iPhone (wireless) (mobile) • 00008110-00167CEE0C46401E • ios
          • iOS 18.0.1 22A3370
        • macOS (desktop)                     • macos                     •
          darwin-arm64   • macOS 26.4.1 25E253 darwin-arm64
        • Chrome (web)                        • chrome                    •
          web-javascript • Google Chrome 155.0.8059.85
    
    [✓] Network resources [466ms]
        • All expected network resources are available.
    
    • No issues found!
    
  3. added
    p: material_uimaterial_ui package in flutter/packages
    packageflutter/packages repository. See also p: labels.
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Oct 26, 2026
  4. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Oct 27, 2026
  5. changed the title [-]DropdownButtonFormField: InputDecoration looks enabled and reacts to hover when enabled: false[/-] [+][material_ui] DropdownButtonFormField: InputDecoration looks enabled and reacts to hover when enabled: false[/+] on Oct 27, 2026
  6. theprantadutta commented on Oct 28, 2026

    @theprantadutta
    Contributor

    I've opened flutter/packages#13473 with a fix. DropdownButtonFormField never set enabled on the decoration it passes to InputDecorator, so the decorator kept its enabled border and fill and still reacted to hover. The PR marks the decoration disabled whenever the dropdown is disabled, as TextField does.

  7. added a commit that references this issue on Nov 6, 2026
    aa134bb
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

    P2Important issues not at the top of the work listp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-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