这是indexloc提供的服务,不要输入任何密码
Skip to content

Fixed passing autofocus to MaterialButton, and when rebuilding Focus widget. #39903

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

Merged
merged 2 commits into from
Sep 10, 2019

Conversation

gspencergoog
Copy link
Contributor

Description

Fixed passing autofocus to MaterialButton, and when rebuilding Focus widget, and added a test for Focus and MaterialButton to test that it works properly.

Tests

  • Added a test for MaterialButton and for Focus to test autofocus, even when autofocus is added after the initial build.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.
  • I checked all the boxes!

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Sep 5, 2019
@gspencergoog gspencergoog added a: desktop Running on desktop and removed a: desktop Running on desktop labels Sep 5, 2019
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1006,6 +1006,29 @@ void main() {
expect(rootNode.hasFocus, isTrue);
expect(rootNode, equals(firstElement.owner.focusManager.rootScope));
});
testWidgets('Can autofocus a node.', (WidgetTester tester) async {
final FocusNode focusNode = FocusNode(debugLabel: 'MaterialButton');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the debugLabel makes sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me either! Thanks, fixed.

@gspencergoog gspencergoog merged commit a7c06e1 into flutter:master Sep 10, 2019
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Sep 30, 2019
…widget. (flutter#39903)

Fixed passing autofocus to MaterialButton, and when rebuilding Focus widget, and added a test for Focus and MaterialButton to test that it works properly.
@gspencergoog gspencergoog deleted the fix_button_autofocus branch October 9, 2019 18:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants