Skip to content
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

Character count's character/word count functions should be customisable #1364

Open
36degrees opened this issue May 20, 2019 · 2 comments
Open
Labels

Comments

@36degrees
Copy link
Contributor

Following on from #1104, whatever 'default' way we use to count characters (code points, bytes, characters) ideally it should match the way that a service's backend validation will count them. For this reason, we should consider making the count function customisable.

For example,

new CharacterCount($characterCount).init({ countFunction: string => string.length })
@fofr
Copy link
Contributor

fofr commented May 20, 2019

Same is probably true for word count: alphagov/govuk-design-system-backlog#67 (comment)

@36degrees
Copy link
Contributor Author

Thinking about it, we might also want to support passing a regex as a string, as well as passing a function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants