-
Notifications
You must be signed in to change notification settings - Fork 332
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
Rename name
of date-input component to namePrefix
#984
Conversation
This is better reflective of the purpose of the argument, which is to prefix the `name` attribute of `items`. This naming is consistent with other components which use the name `idPrefix` to explain similar functionality.
a7f4153
to
3c9dba0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -72,6 +72,14 @@ | |||
|
|||
([PR #969](https://github.com/alphagov/govuk-frontend/pull/969)) | |||
|
|||
- Rename `name` argument of date-input component to `namePrefix`. | |||
|
|||
This is better reflective of the purpose of the argument, which is to prefix the `name` attribute of `items`. This is consistent with other components which use the name `idPrefix` to explain similar functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changelog entry – I think this gets the intention across well, and makes it clear what the user needs to do 👍
src/components/date-input/README.njk
Outdated
@@ -55,7 +55,7 @@ | |||
text: 'No' | |||
}, | |||
{ | |||
text: 'Optional name. This is used to compose the name attribute for each item.' | |||
text: 'Optional prefix. This is used to prefix each `item.name`.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's worth mentioning that they'll be joined using "-"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍 I thought initially about adding it but it felt like too much about the implementation. But it's probably useful information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
3c9dba0
to
7f3af3d
Compare
7f3af3d
to
c146193
Compare
The
name
argument on the date-input component acts as a prefix for each input's name, but this behaviour is not clear or consistent with how we usename
in other components.This PR renames it to
namePrefix
. This is consistent with other components (like checkboxes and radios) which use the nameidPrefix
to explain similar functionality.Fixes #909
https://trello.com/c/CFN5bvev/1392-2-behaviour-of-date-inputs-name-argument-is-not-clear