Repository navigation
SearchBar open search view on tap when enabled option in the SearchBar is set to false #150331
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to reproduce
- Create a simple SearchAnchor and return SearchBar in the builder.
- Set the enabled option in the SearchBar to false.
- Run and click on SearchBar.
Expected results
Expect to be ignored on tap call
Actual results
Code sample
Code sample
SearchAnchor(
builder: (BuildContext context, SearchController controller) {
return const SearchBar(
enabled: false,
);
},
suggestionsBuilder:
(BuildContext context, SearchController controller) {
return [];
},
),Screenshots or Video
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!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
darshankawar commentedon Jun 17, 2024
Thanks for the report. I was able to replicate the reported behavior on latest versions in all platforms. With
enabled: false, the textfield is still enabled and accepts input. The property was added as part of #137388stable, master flutter doctor -v
/cc @Macacoazul01
Macacoazul01 commentedon Jun 27, 2024
@darshankawar im finishing an update for my app these days so my free time is really short right now. Gonna try a fix for this right after the update lands.
Macacoazul01 commentedon Aug 3, 2024
@silentlie with the
SearchBaronly is everything ok?silentlie commentedon Aug 4, 2024
It's fined for now. I'd hide the search bar if I don't want it to be enabled. But it'd be better for it to be disabled for aesthetics
Macacoazul01 commentedon Aug 12, 2024
@darshankawar, @silentlie this PR should fix the problem.
Macacoazul01 commentedon Aug 14, 2024
@darshankawar who is responsible for the review of this one?
The tests went ok!
darshankawar commentedon Aug 14, 2024
@Macacoazul01 You may request review as suggested and also add @Piinks
added enabled to search anchor (#153256)
github-actions commentedon Sep 19, 2024
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 -vand a minimal reproduction of the issue.