Skip to content

Conversation

@olof-dev
Copy link
Contributor

@olof-dev olof-dev commented Jun 19, 2022

The current documentation for TextField.maxLength and CupertinoTextField.maxLength suggests that 'character' means "Unicode scalar value", but this is not actually what 'character' means in this context. As described explicitly a little further down on the doc page, and on the page for LengthLimitingTextInputFormatter.maxLength, multiple Unicode scalar values can combine to form one user-perceived character.

This PR corrects the documentation by changing "Unicode scalar values" to "Unicode grapheme clusters", as described in the characters package documentation.

I haven't created a separate issue for this minor docs change; happy to file one if needed.

cc @gspencergoog (as the person git suggests worked on this)

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. Hopefully N/A.
  • 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.

@flutter-dashboard flutter-dashboard bot added a: text input Entering text in a text field or keyboard related problems f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Jun 19, 2022
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

LGTM. @gspencergoog would you like to take a look?

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Thanks for changing that, I'm sure it was an oversight when we migrated. It used to be the case that they were scalar values (before Dart had support for grapheme clusters), but we have integrated the Characters class and now the character count truly are grapheme clusters.

@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 16, 2022
@auto-submit auto-submit bot merged commit 89e88f8 into flutter:master Aug 16, 2022
@olof-dev olof-dev deleted the patch-1 branch August 17, 2022 06:08
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 17, 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 autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository 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.

3 participants