Skip to content

SearchBar open search view on tap when enabled option in the SearchBar is set to false #150331

@silentlie

Description

@silentlie

Steps to reproduce

  1. Create a simple SearchAnchor and return SearchBar in the builder.
  2. Set the enabled option in the SearchBar to false.
  3. Run and click on SearchBar.

Expected results

Expect to be ignored on tap call
1

Actual results

Open search view instead
1

Code sample

Code sample
        SearchAnchor(
          builder: (BuildContext context, SearchController controller) {
            return const SearchBar(
              enabled: false,
            );
          },
          suggestionsBuilder:
              (BuildContext context, SearchController controller) {
            return [];
          },
        ),

Screenshots or Video

Screenshots / Video demonstration

1

Logs

Logs

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.19045.4529], locale en-AU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
[√] Android Studio (version 2023.2)
[√] VS Code, 64-bit edition (version 1.90.0)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-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