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

Publish prefix / suffix variant for text input #1915

Closed
4 tasks done
hannalaakso opened this issue Aug 13, 2020 · 2 comments · Fixed by #1816
Closed
4 tasks done

Publish prefix / suffix variant for text input #1915

hannalaakso opened this issue Aug 13, 2020 · 2 comments · Fixed by #1816

Comments

@hannalaakso
Copy link
Member

hannalaakso commented Aug 13, 2020

What

Publish the prefix / suffix variant for text input contributed by @simonwhatley 🎉

Further detail

Preview
Guidance PR: alphagov/govuk-design-system#1269
Component PR: #1816
Feedback from June 2020 Working Group review: alphagov/govuk-design-system#1269 (comment)

Done when

  • Ensure that the variant works on smaller viewports - see comment for details
  • Swap span elements for div elements (so that they can contain block level elements if needed)
  • Consider adding some more stress cases to Frontend review app
  • Add automated tests for the variant
@hannalaakso
Copy link
Member Author

hannalaakso commented Aug 13, 2020

Behaviour on small viewports

We need to make sure that users on smaller (possibly zoomed in) viewports can use the component and the input remains visible.

Current behaviour

Screenshot 2020-08-12 at 10 42 44

This is iPhone XS on iOS 13 with 175% zoom (using the a/A buttons).

Suggested behaviour

We could split the component onto multiple lines on small resolutions, with something like

Screenshot 2020-08-12 at 11 00 48

(but with borders etc. tidied up)

@hannalaakso hannalaakso self-assigned this Aug 13, 2020
@hannalaakso hannalaakso transferred this issue from alphagov/govuk-design-system Aug 13, 2020
@CharlotteDowns CharlotteDowns self-assigned this Aug 18, 2020
@CharlotteDowns
Copy link
Contributor

Design Suggestions

Flexible across viewports

@hannalaakso and I discussed if it was possible to have a flexible way of expanding the prefix and suffix areas to fit the content that is placed into them.

800px wide view with prefix, input and suffix inline
320px wide view with prefix and input inline, suffix on second row
180px wide view with prefix, input and suffix on separate rows

This may be hard to achieve and maintain across operating systems and browsers.

Prefix integrated into input

We also discussed whether it was possible to include the prefix within the input – seen in a Lloyds bank example.

Lloyds Bank example of a green pound sign in the input field
Mockup of a GOV.UK input with a prefix in the input

This again would need user research to determine whether it improves the usability and if it would adhere to the latest WCAG guidelines.

Results of conversation

In conclusion the solution Hannah proposed earlier on this card where she has mocked up a 100% width solution for prefixes, inputs and suffixes seems like the most suitable design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants