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 token value autosize #2762

Merged
merged 1 commit into from
May 17, 2024
Merged

Fix token value autosize #2762

merged 1 commit into from
May 17, 2024

Conversation

macintoshhelper
Copy link

@macintoshhelper macintoshhelper commented May 16, 2024

Why does this PR exist?

Fixes #2721

What does this pull request do?

If users try to enter something like a long linear-gradient value and the value goes quite wide, the text input currently is not big enough to make sense of anything. Let's find a way where the input grows in height when users enter more.

MentionsInput height CSS is changed to auto; MentionsInput already has the autosize prop passed to it.

We need to watch out for the prepending and appending button to the left so that those are still displayed correctly (likely vertical alignment top)

Handled by adding height: auto CSS to <StyledPrefix ... />. The prefix is automatically vertically aligned to the center.

Testing this change

  1. Open Tokens Tab
  2. Scroll down to Typography
  3. Create a Token with a very long name
  4. Click + (Add New Token)
  5. Under the Typography fields, try entering very long values – verify that the input textarea expands to multiline
  6. Change to Reference Mode
  7. Click the dropdown button, or mention the very long Typography token by typing { to bring up the mention dropdown
  8. Verify that the input textarea expands to multiline

Additional Notes (if any)

Before After
Before – Tokens / Typography / New Token After – Tokens / Typography / New Token
Before – Tokens / Typography / New Token After – Tokens / Typography / New Token
Before – Tokens / Typography / New Token After – Tokens / Typography / New Token
Before – Tokens / Typography / New Token After – Tokens / Typography / New Token
Before – Tokens / Typography / New Token After – Tokens / Typography / New Token
Before – Tokens / Typography / New Token After – Tokens / Typography / New Token

Copy link

changeset-bot bot commented May 16, 2024

⚠️ No Changeset found

Latest commit: a791dd6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator

@six7 six7 left a comment

Choose a reason for hiding this comment

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

Nice!

@six7 six7 merged commit bf81ac1 into release-139 May 17, 2024
5 of 6 checks passed
@six7 six7 deleted the fix/2721-token-value-autosize branch May 17, 2024 06:54
@mikekamminga
Copy link

Looks good 🚀

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.

None yet

3 participants