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

Date input macro styling breaks if item name is changed #836

Closed
olliewilliams-CH opened this issue Jun 26, 2018 · 0 comments · Fixed by #857
Closed

Date input macro styling breaks if item name is changed #836

olliewilliams-CH opened this issue Jun 26, 2018 · 0 comments · Fixed by #857
Assignees
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation)

Comments

@olliewilliams-CH
Copy link

Issue type: Bug
Component: Date Input
Location: Macro - template.njk
Version: 1.0.0
Prototype Kit Version: 7.0.0-beta.9

Details:
When using the nunjucks macro to produce a date input component, changing the name of the year object inside items with break the styling on the year input field that makes it 4 characters in width rather than the default 2 characters. This happens because the value of item.name for each input field provided via the macro is recycled to also set the CSS class on the inputs container div. This is a fixed class name that, if changed, will result in a loss of styles for that class.

Reproduction:
Use the default macro code from the docs to create a date input component. Change item.name for the year field from "year" to "Year" or any other string.

Code Sample:

<div class="govuk-date-input__item govuk-date-input__item--year">
      <div class="govuk-form-group">
        <label class="govuk-label govuk-date-input__label" for="illness-end-year">
          Year
        </label>
        <input class="govuk-input govuk-date-input__input" id="illness-end-year" name="illnessEnd-year" type="number" pattern="[0-9]*">
      </div>
    </div>
@joelanman joelanman added the 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) label Jun 26, 2018
@alex-ju alex-ju self-assigned this Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants