Skip to content

Improve documentation of EditableText/TextField callbacks#98414

Merged
fluttergithubbot merged 2 commits intoflutter:masterfrom
NevercodeHQ:update_editable_text_doc
Mar 4, 2022
Merged

Improve documentation of EditableText/TextField callbacks#98414
fluttergithubbot merged 2 commits intoflutter:masterfrom
NevercodeHQ:update_editable_text_doc

Conversation

@TahaTesser
Copy link
Contributor

@TahaTesser TahaTesser commented Feb 14, 2022

fixes #27581

1. TextField doesn't mention order of onSubmitted vs onEditingComplete vs onChanged.

Solution:
Made Lifecycle from EditableText as a template so it can be reused in TextField

2. The documentation for each of these events doesn't mention the others.

Solution:

  • Update onSubmitted to indicate when it will be called relative to other callbacks
  • Update onChange to indicate when it will be called relative to other callbacks

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Feb 14, 2022
@TahaTesser TahaTesser changed the title Mention the order in onSubmitted vs onEditingComplete vs onChanged ha… Improve documentation of EditableText/TextField callbacks Feb 14, 2022
@HansMuller HansMuller requested a review from cbracken February 25, 2022 22:53
Copy link
Member

@cbracken cbracken Mar 4, 2022

Choose a reason for hiding this comment

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

Maybe:

/// By default, [onSubmitted] is called after [onChanged] when the user 
/// has finalized editing; or, if the default behavior has been overridden,
/// after [onEditingComplete]. See [onEditingComplete] for details.

Also minor nit, behaviour -> behavior. I'm guilty of adding hundreds of non-US spellings to our codebase myself, and occasionally do passes over the code to fix all the ones I missed 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh thanks so much, I will keep it in mind for future doc PRs)

@TahaTesser TahaTesser force-pushed the update_editable_text_doc branch from b7bb6f8 to 87d16ca Compare March 4, 2022 18:47
@fluttergithubbot fluttergithubbot merged commit e047fe7 into flutter:master Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems 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.

TextField documentation should say the order in which onSubmitted vs onEditingComplete vs onChanged happens

3 participants