As a developer, I want to be able to set the minlength and the maxlength on a GCDS form component, so that I can set a limit for character input.
β Definition of Done / Outcomes
[ ] The requirements documentation has been updated and reviewed
[ ] Done when requirement doc is reviewed by a fellow developer (optional)
[ ] Done when requirement doc is reviewed by a designer (optional)
[ ] Done when requirement doc has final review by tech lead (optional)
[ ] Done when requirement doc has final review by design lead (optional)
π Acceptance criteria
[ ] Contains the new properties minlength and maxlength
[ ] Considers the extra check or validation for providing a minlength attribute
[ ] Considers the extra check or validation for providing a maxlength attribute
[ ] Considers the extra check or validation for providing a size attribute along with either minlength or maxlength or both
π More info
A support ticket came in saying the user is unable to set minlength and maxlength. Previously, we were using the size component to set the maxlength but moved away from it because it severely limits the component and only adds further confusion. After talking to design (Dylan), we'd like to rethink our approach. Here is the initial proposal:
We can check if they set these to something out of bounds in relation to the "size" property
Display the element, but show an error on the console; or--
Do not render the element and show an error on the console
π User story
minlength
and themaxlength
on a GCDS form component, so that I can set a limit for character input.β Definition of Done / Outcomes
π Acceptance criteria
minlength
andmaxlength
minlength
attributemaxlength
attributesize
attribute along with eitherminlength
ormaxlength
or bothπ More info
A support ticket came in saying the user is unable to set
minlength
andmaxlength
. Previously, we were using thesize
component to set themaxlength
but moved away from it because it severely limits the component and only adds further confusion. After talking to design (Dylan), we'd like to rethink our approach. Here is the initial proposal:π¦ Another thought for consideration: adding a character count indicator for inputs. Gov UK recommends doing so if you are limiting the characters
βοΈ Freshdesk ticket: https://cds-snc.freshdesk.com/a/tickets/19158