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

fix(TextInput): set label text to xs to avoid resizing container on focus #1276

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

agreatscott
Copy link
Contributor

@agreatscott agreatscott commented Jun 27, 2024

This one had me stumped for a minute but it ended up being something pretty obvious - when the TextInput was focused, you could see the container get taller which resulted in the page content shifting downward, not desirable behavior.

I figured out that it was caused by this commit because reverting it fixed the issue, but I was sure it must be something to do with the negative margins on the label that had been changed to use the rem function. Turns out, we were just setting the label font to be too big. After I made this change, I can confirm in my browser that --font-size-xs is 0.75rem which calculates under default settings to 12px, which is what it used to be before that commit. --font-size-s made it 14px which resulted in the resizing on focus.

Copy link

📘 Storybook Preview Available 👀

View the Storybook build from this PR in your browser:
https://60620d422ffdf100216415b2-ghlorryfgz.chromatic.com/

(This action will publish a new comment and url if this PR is modified)

Copy link
Collaborator

@akdetrick akdetrick left a comment

Choose a reason for hiding this comment

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

this is such an elegant fix!

@agreatscott agreatscott merged commit 4777dc2 into main Jun 27, 2024
7 checks passed
@narmirobot
Copy link

🎉 This PR is included in version 3.41.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants