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

Safari browser choose file text not aligned correctly when page maximised #2194

Closed
moylesp opened this issue Apr 16, 2021 · 1 comment · Fixed by #2201
Closed

Safari browser choose file text not aligned correctly when page maximised #2194

moylesp opened this issue Apr 16, 2021 · 1 comment · Fixed by #2201
Assignees
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) file upload
Milestone

Comments

@moylesp
Copy link

moylesp commented Apr 16, 2021

Description of the issue

When viewing option to upload a file using the Choose File button, the associated text of no file selected does not align correctly.

Steps to reproduce the issue

open link in Safari browser https://design-system.service.gov.uk/components/file-upload/

image

Actual vs expected behaviour

I would expect that the text would align correctly. This does happen if you reduce the size of the browser window and can display correctly
image

Environment (where applicable)

I am testing on the Land Registry web site, but I have included a link to the file uploader example https://design-system.service.gov.uk/components/file-upload/

  • Operating system: Mac Catalina

  • Browser: Safari

  • Browser version:
    image

  • GOV.UK Frontend Version:

@moylesp moylesp added awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) labels Apr 16, 2021
@vanitabarrett vanitabarrett self-assigned this Apr 19, 2021
@vanitabarrett
Copy link
Contributor

Thanks for raising this @moylesp . I've had a look, and it looks like this is happening because the font-size of the file upload button isn't changing as it should do (and as it does in other browsers). On mobile, the button and the text are both 16px and therefore align correctly. However, on desktop they should both be 19px but in Safari this only applies to the text which pushes it out of alignment.

To me, this looks like a Safari bug as it doesn't seem possible to change the font-size of the file upload button. Strangely enough, this only seems to work if you also set the background color using ::-webkit-file-upload-button. I've raised an issue with Safari, so we'll have to see what comes back from that.

@vanitabarrett vanitabarrett removed the awaiting triage Needs triaging by team label Apr 19, 2021
@vanitabarrett vanitabarrett added this to the v3.12.0 milestone Apr 26, 2021
vanitabarrett pushed a commit that referenced this issue Apr 27, 2021
While working on #2194 , we noticed that the file upload component 'jumps' slightly to the left on focus.

This is because we are applying padding and a negative margin on focus.
This commit instead reworks that CSS to apply the padding and negative margin by default.
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) file upload
Projects
Development

Successfully merging a pull request may close this issue.

3 participants