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

Fixing center select text on Safari #404

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mmircea16
Copy link
Contributor

should close #396

Turns out that fixing issue around having the text on the select centered is not trivial - read more here: https://stackoverflow.com/questions/10813528/is-it-possible-to-center-text-in-select-box/44499549

The recommended approach is using text-align-last however that is not supported on Safari. There are a couple of hacks possible, the one it seemed to be the least intrusive was to cover the select with a span that looks exactly like the select. Additionally, I have chosen to use the hack only when the text-align-last property is not supported by the browser to keep impact of the hack low.

Also I put it here and not in the components library to make sure it works as expected - if it does and feel like this something that is more widely usable - we should move it to the components repo.

Testing:
Manual on firefox, chrome and safari - can someone please check in on IE11 and Edge?

@vercel
Copy link

vercel bot commented Apr 30, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/code4romania/stam-acasa/i8maktrx8
✅ Preview: https://stam-acasa-git-safari-select-center.code4romania.now.sh

@mmircea16 mmircea16 requested a review from moonflare April 30, 2020 12:44
@Utwo
Copy link
Member

Utwo commented May 1, 2020

I think only for a centered text inconsistency this is too much of a hack. Especially that the inconsistency it's only on Safari.

@surdu surdu added the front-end label May 2, 2020
Copy link
Member

@catileptic catileptic left a comment

Choose a reason for hiding this comment

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

As per @Utwo 's comment, let's hang onto this PR for a while and not merge it. If it becomes a serious problem, we'll merge it.
(no actual changes requested, just needed a way to block merging)

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.

Weird dropdown label display on Safari
4 participants