govuk-frontend-wtf icon indicating copy to clipboard operation
govuk-frontend-wtf copied to clipboard

Automatically pass maxlength param to character count templates

Open matthew-shaw opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. When using the GovCharacterCount you have to set the length limit in both the WTForm field validator and pass the maxlength param to the template.

Describe the solution you'd like Take the max length set in the validator and pass it as a default param to the template, so that developers don't have to set it twice, and risk missing or not changing one.

Describe alternatives you've considered None other than the current approach

Additional context The maxlength param must always be equal to the length.max validator.

matthew-shaw avatar Nov 24 '21 11:11 matthew-shaw