-
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
Define minimum width for select component #2670
Conversation
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.
One nitpick, otherwise looking sharp 👍🏻 This also needs a changelog entry (I think?)
@@ -7,6 +7,7 @@ | |||
@include govuk-font($size: 19, $line-height: 1.25); | |||
|
|||
box-sizing: border-box; // should this be global? | |||
min-width: 23ex; |
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 think your reasoning in the PR is sound. Is it worth trying to summarise that in a comment here?
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.
Added a code comment parroting my comment above.
Also added a changelog entry, currently listed as a fix, though I suppose this could also be a new feature, in a sense??
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, cheers! I see what you mean about it being a new feature potentially but my instinct is to keep it a fix as it's technically fixing the problem of the select not having a min-width.
4cfc7ff
to
e771379
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.
✅
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.
Marking this as 'request changes' only because we haven't reached agreement on using ex
yet.
e771379
to
53e6d38
Compare
We've since merged a change to the Text Input component to use em units instead of ex. I've updated this PR to reflect that change. |
Co-authored-by: Vanita Barrett-Smith <vanita.barrett@digital.cabinet-office.gov.uk>
Adds a minimum width of the select component to account for situations where the value list may be loaded asyncronously, as requested in #2170.
As there is no 'standard' minimum width for selects, I opted to use 23 ex—equivalent to about 184 pixels wide on mobile, and 218 pixels wide on tablet and above.
I used 23 ex for a few reasons:
.govuk-input--width-10
class applied..govuk-width-container
and still comfortably fit on screens 240 pixels wide, which is the narrowest screen resolution with any significant presence in GOV.UK's analytics (the narrowest to be in triple digits, anyway), and one apparently still used on modern feature phones(!)Comparisons
Mobile
Tablet/desktop