Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus#130164
Merged
justinmc merged 11 commits intoflutter:masterfrom Aug 2, 2023
Merged
Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus#130164justinmc merged 11 commits intoflutter:masterfrom
justinmc merged 11 commits intoflutter:masterfrom
Conversation
This was referenced Jul 7, 2023
QuncCccccc
approved these changes
Jul 10, 2023
Contributor
QuncCccccc
left a comment
There was a problem hiding this comment.
LGTM! Thanks a lot for providing a better fix for DropdownMenu!
| _effectiveFocusNode.canRequestFocus = widget.canRequestFocus && _isEnabled; | ||
| _effectiveFocusNode.canRequestFocus = widget.focusNode == null | ||
| ? widget.canRequestFocus && _isEnabled | ||
| : widget.focusNode!.canRequestFocus && _isEnabled; |
Contributor
There was a problem hiding this comment.
nit: should the indentation be 2-character space?
Contributor
Author
There was a problem hiding this comment.
Looks like there are both 2 and 4 spacing for this kind of ternary in this file haha. I'll normalize it all to 2 spaces.
| return widget.canRequestFocus && _isEnabled; | ||
| return widget.focusNode == null | ||
| ? widget.canRequestFocus && _isEnabled | ||
| : widget.focusNode!.canRequestFocus && _isEnabled; |
Contributor
Author
|
I'm struggling to get the Google tests to run but otherwise this is ready to land. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 3, 2023
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
Aug 3, 2023
flutter/flutter@b3f99ff...c00d241 2023-08-03 [email protected] Manual roll Flutter Engine from 9304c0074d29 to 4c1157b9da54 (24 revisions) (flutter/flutter#131830) 2023-08-03 [email protected] Assert against infinite values of control points in CatmullRomSpline (flutter/flutter#131820) 2023-08-02 [email protected] Update stack_frame.dart to parse unexpected error format to null. (flutter/flutter#131786) 2023-08-02 [email protected] Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus (flutter/flutter#130164) 2023-08-02 [email protected] Mention that the widget tree is not disposed on exit (flutter/flutter#131637) 2023-08-02 [email protected] [framework] Add Look Up to selection controls for iOS (flutter/flutter#131798) 2023-08-02 [email protected] Add documentation in flutter.groovy noting that we always use the latest available android version (flutter/flutter#131705) 2023-08-02 [email protected] [framework] lerp images in a save layer. (flutter/flutter#131703) 2023-08-02 [email protected] Roll Packages from 3dc00c1 to 4e4961a (1 revision) (flutter/flutter#131788) 2023-08-02 [email protected] add gem dependency to the ios_app_with_extensions_test (flutter/flutter#131713) 2023-08-02 [email protected] Roll Flutter Engine from d6b962d0e36d to 9304c0074d29 (4 revisions) (flutter/flutter#131790) 2023-08-02 [email protected] [flutter_tools] set terminal.singleCharMode to false after attach finishes (flutter/flutter#131723) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
sfshaza2
added a commit
to flutter/website
that referenced
this pull request
Aug 3, 2023
Added a migration guide for a deprecation in flutter/flutter#130164. Still waiting for that to merge to finish the Timeline section. ## Presubmit checklist - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --------- Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Jasguerrero
added a commit
to Jasguerrero/flutter
that referenced
this pull request
Aug 8, 2023
…nRequestFocus" (flutter#132104) Reverts flutter#130164 reverting because it cause internal google testing failures b/294917394
justinmc
added a commit
to justinmc/flutter
that referenced
this pull request
Aug 9, 2023
…Focus (flutter#130164) Simplifying the TextField API.
4 tasks
parlough
pushed a commit
to flutter/website
that referenced
this pull request
Jan 7, 2026
We made a breaking change to remove `TextField.canRequestFocus` (flutter/flutter#130164). However, this caused a google3 failure and was reverted (flutter/flutter#132104). This removes the breaking change guide since we never relanded this change: * flutter/flutter#149067 * flutter/flutter#132273
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TextField.canRequestFocus was added in #117504, but it seems to be redundant with the TextField's FocusNode's canRequestFocus parameter. This PR deprecates TextField.canRequestFocus and uses FocusNode.canRequestFocus where it was previously used in DropdownMenu.
Migration guide: flutter/website#8994
Buggy behavior of
TextField.canRequestFocus: falseThis bug, reported in #130011, still persists after this PR if you set
TextField.focusNode.canRequestFocusto false. That issue should stay open to track it. However, now thatcanRequestFocusis deprecated, it at least is harder to encounter and doesn't seem to be endorsed by the API.Issue: #130011