-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus #130164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
QuncCccccc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should the indentation be 2-character space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
|
I'm struggling to get the Google tests to run but otherwise this is ready to land. |
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
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]>
…nRequestFocus" (flutter#132104) Reverts flutter#130164 reverting because it cause internal google testing failures b/294917394
…Focus (flutter#130164) Simplifying the TextField API.
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