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

SPIKE: Add character count for driving licence to details page #83

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

wilsond-gds
Copy link

Proposed changes

This is a working proof of concept for integrating the GDS Design System character count into the driving licence CRI form.

What changed

The character count component gives users a real-time countdown of the number of characters they have left to enter information. To make this work in the HMPO app context, these files were changed:

  • src/assets/scss/application.scss to remove the resize user interface for the <textarea> used by the character count component
  • src/locales/en/fields.yml removes the maxlength from the field, as setting maxlength does not report the status of user input to the user for screenreaders
  • src/views/drivingLicence/details.html uses the custom hmpoCountText nunjucks macro which instantiates the character count component for DVA and DVLA driving licence
  • src/views/drivingLicence/hmpoCountText.njk is a modification of the hmpoCount nunjucks macro which displays the form field using the passed-in variables, with the addition of the character count macro.

Currently the new form has not been tested to ensure that the information users supply is being sent to the backend correctly, but the validation does seem to be correct when tested with details from a real driving licence.

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

Successfully merging this pull request may close these issues.

None yet

1 participant