Skip to content

select does not take the font size into account #54

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

Closed
mooxl opened this issue Mar 10, 2021 · 7 comments
Closed

select does not take the font size into account #54

mooxl opened this issue Mar 10, 2021 · 7 comments

Comments

@mooxl
Copy link

mooxl commented Mar 10, 2021

If the font size of a select field is changed, the height of the field does not adjust and the text is cut off.

Code for reproducing:

<select className="text-xxl">
      <option>default size</option>
</select>
<input type="text" className="text-xxl"/>

Images:
Bildschirmfoto 2021-03-10 um 12 00 16

Bildschirmfoto 2021-03-10 um 12 04 18

@mooxl mooxl changed the title select does not take into account the font size select does not take the font sice into account Mar 10, 2021
@mooxl mooxl changed the title select does not take the font sice into account select does not take the font size into account Mar 10, 2021
@adamwathan
Copy link
Member

Hey! Can't reproduce this, works as expected:

https://play.tailwindcss.com/m4nkWD9C9f

image

Please provide an actual reproduction if this is still an issue for you and you can verify by comparing against my demo that it's not user error.

@mooxl
Copy link
Author

mooxl commented Mar 10, 2021

Hey, thanks for the quick reply!
I forgot to mention that in my example I set the font size of the body to 62.5% so that I can convert the rem sizes more easily.
Does this make it a mistake that I should fix from my side?

@adamwathan
Copy link
Member

Still works when you do that:

https://play.tailwindcss.com/UOfYogDtPv?file=css

@mooxl
Copy link
Author

mooxl commented Mar 10, 2021

strange... then I must have done something wrong on my side. I'll get to the bottom of it and let you know as soon as I find the reason. Thanks for the quick reply!

@mooxl
Copy link
Author

mooxl commented Mar 10, 2021

After transferring the settings of my project, I finally found the cause of the bug described above.
Apparently the reason is the use of individual text sizes:

https://play.tailwindcss.com/gZvO8KsBSQ

@adamwathan
Copy link
Member

Ah yep in this case it's because your custom font size doesn't have a default line-height associated with it. Add your desired line-height to the select when setting the font size and you're good:

https://play.tailwindcss.com/O5ZqffHuJS

<select class="text-custom leading-tight">...</select>

@mooxl
Copy link
Author

mooxl commented Mar 10, 2021

Sometimes it can be as simple as that. I didn't have the line height in mind.
Thank you very much!

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

No branches or pull requests

2 participants