• Greg Spencer's avatar
    Add Material character counter to TextField. (#12648) · ea679171
    Greg Spencer authored
    This adds an optional character counter and maxLength parameter to the TextField, as described in the Material Design Spec.
    
    The counter text and style in the input decorator may be specified, but will default to the "right thing" if not specified, where the "right thing" is a counter that looks like "3 / 10" (if there are three characters entered into a field where maxLength is set to 10).
    
    To limit the number of characters entered, I created a LengthLimitingTextFormatter that will limit the number of characters (Unicode runes) in the input, which can be used independently. The formatter is applied after the other formatters supplied (if any). Even if there is no decorator, the text field will limit the number of characters input if maxLength is set.
    
    If maxLengthEnforced is set to false (it defaults to true), then the max length will not be enforced. In that case, if the text exceeds the length, then the counter will turn red, and it will make the divider turn red.
    ea679171
Name
Last commit
Last update
.idea Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
ISSUE_TEMPLATE.md Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
analysis_options.yaml Loading commit data...
analysis_options_repo.yaml Loading commit data...
appveyor.yml Loading commit data...