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

Update select component width #960

Merged
merged 5 commits into from
Sep 7, 2018
Merged

Conversation

dashouse
Copy link

@dashouse dashouse commented Aug 20, 2018

This PR:

Creates a govuk-!-width-full override (previously we only had width to reduce the size of 100% elements

Removes the width: 100% declaration on the select so they are the size of the content by default

Why

The styling of the <select> component (dependant on browser) is very similar to a text input. The arrows on the right hand side indicate the behaviour of this component, however because we made it 100% wide by default, a select with a small amount of content, when zoomed in is not obvious.

Edit: This was found in an external audit

For example:
screen shot 2018-08-20 at 12 00 17

This change reverts to the default <select> behaviour, being sized by it's content so the icon appears closer to the content.

screen shot 2018-08-20 at 12 01 31

If a user would like to resize their select, for example they are sizing it based on being 100% wide within a container this can be done with the override class

screen shot 2018-08-20 at 12 01 37

@kr8n3r
Copy link

kr8n3r commented Aug 20, 2018

it's missing the updated readme and changelog. on that, i'm on the fence whether this is a breaking change or not

@dashouse
Copy link
Author

Cool, I will do the changelog at the last minute if approved for minimal merge conflicts :)

Will discuss in channel about breaking change of not

@NickColley
Copy link
Contributor

@dashouse can you please update the PR summary to explain what problem you're solving?

@dashouse
Copy link
Author

@NickColley Hopefully this covers it...

@36degrees
Copy link
Contributor

@dashouse the READMEs need regenerating to add the new example, which is why the tests are failing.

Can you please run gulp generate:readme and commit the updated README?

@36degrees
Copy link
Contributor

I think if we're in any doubt, given we're going to be doing a major release next anyway, we should record this as a breaking change.

@NickColley NickColley added this to the v2.0.0 milestone Sep 4, 2018
@dashouse dashouse force-pushed the update-select-component-width branch from 23ce3f8 to 3b47774 Compare September 6, 2018 14:41
CHANGELOG.md Outdated
@@ -72,8 +72,20 @@

([PR #969](https://github.com/alphagov/govuk-frontend/pull/969))

- Remove the width declaration from the `<select>` component

The `<select>` component’s width will now be defined by it’s content. This addresses some accessibility issues with the select being 100% wide by default. If you want to style your select to be 100% wide we have added a new override class to allow this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking it would be good to explicitly reference the new class that can be used, not the end of the world though.

@dashouse dashouse force-pushed the update-select-component-width branch from a5d90df to 46c7c2f Compare September 7, 2018 06:15
@dashouse dashouse force-pushed the update-select-component-width branch from 46c7c2f to 8e4cbf8 Compare September 7, 2018 06:18
@dashouse dashouse merged commit e4e9440 into master Sep 7, 2018
@dashouse
Copy link
Author

dashouse commented Sep 7, 2018

Updated changelog and merged, thanks

@dashouse dashouse deleted the update-select-component-width branch September 7, 2018 07:06
@NickColley NickColley mentioned this pull request Sep 10, 2018
paroxp added a commit to alphagov/paas-admin that referenced this pull request Oct 11, 2018
One of the changes the new Frontend version introduces[1] is the lack of
the full size select boxes by default.

In order to keep up with the design as much as possible, we're adding
the extra class to force these expand as they use to.

[1]: alphagov/govuk-frontend#960
AP-Hunt pushed a commit to alphagov/paas-admin that referenced this pull request Apr 17, 2019
One of the changes the new Frontend version introduces[1] is the lack of
the full size select boxes by default.

In order to keep up with the design as much as possible, we're adding
the extra class to force these expand as they use to.

[1]: alphagov/govuk-frontend#960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants