-
Notifications
You must be signed in to change notification settings - Fork 334
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
Fixes for a couple of component examples / fixtures #2043
Fixes for a couple of component examples / fixtures #2043
Conversation
Omitting this value causes the select to output empty values against each item and so it should be marked as required. Also fixed a couple of the examples to comply with the above.
Ah, I spy a failing snapshot, will sort after lunch |
I've marked this as a draft for a second as I've got more changes coming... |
That should be all the changes now so this is ready for review. I've got govuk-react-jsx passing 100% against the govuk-frontend fixtures now, with the changes made in this pull request hacked into my library as overrides. |
Thank you for raising this PR @andymantell ! I think on the whole we're happy with these changes and it's great to see the examples being made more consistent! However, we're not sure about marking Would you be happy with updating this PR to remove the change that marks |
Ok that's fair enough. I'll remove the required option. I suppose even though I would consider that output with duplicate empty values to be somewhat weird, there may be some use case that I haven't envisaged... From my perspective, so long as the actual examples contain values that are unique and non empty then that works. |
Followup to d824b00 and feedback on corresponding pull request (alphagov#2043)
@vanitabarrett That's done now |
Prompted by #2043, this commit adds a line to the docs for the value option to explain that it defaults to an empty string.
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.
Thanks @andymantell 🙏🏻
I have spotted a couple of issues with the current fixtures whilst using them in govuk-react-jsx. This PR is to fix them...
on the
fieldset params
example in the checkboxes component, thelegend
param was not nested underneath thefieldset
param.On the select component,
value
is not marked as required underneath the items / individual options. If not supplied, the component will render every option with an empty value which I think doesn't make much sense. I have therefore marked it as required, and fixed two of the hidden examples to match (All the other examples already hadvalue
specified. This was causing problems in my react port since React cannot have two<option>
elements with the same underlyingvalue
, even if that value is blank.