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: multiline textarea resizing for json input #4463

Merged

Conversation

spgandhi
Copy link
Contributor

About the changes

Background

https://github.com/orgs/Unleash/discussions/4450

Problem

The textarea when adding JSON payload was of fixed size and did not allow resizing. Although MUI knows to render TextareaAutosize when multiline=true as suggested in their docs - https://mui.com/material-ui/react-text-field/#multiline, but even in their examples in the docs, the resizing is not present. So perhaps some bug on their end

Solution

With this PR we are adding resize: vertical styling if the Input component is rendering the native textarea.
This solution will make both json and csv payload type inputs resizable since they both render as textarea

bytCu0deYU.mp4

@vercel
Copy link

vercel bot commented Aug 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 11:32am
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 11:32am

@vercel
Copy link

vercel bot commented Aug 10, 2023

@spgandhi is attempting to deploy a commit to the unleash-team Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, I think this is a positive step forward!

My only suggestion is to set a minimum height in the textarea so that we cannot resize the field to be smaller than the other input fields. Once we address that, this should be good to go 🙂

@spgandhi
Copy link
Contributor Author

@nunogois thanks for the feedback. I have added the minHeight and ready for review again

@spgandhi
Copy link
Contributor Author

@nunogois just checking in on this PR ^^ :)

@nunogois
Copy link
Member

Thanks for pinging me @spgandhi - I was away for holidays and missed this.

Seems like there's only a small formatting / styling issue that should have been caught by Prettier, but other than that, this looks ready to merge 👍

…tureEnvironmentVariants/EnvironmentVariantsModal/VariantForm/VariantForm.tsx

Co-authored-by: Nuno Góis <github@nunogois.com>
@ivarconr ivarconr self-requested a review August 23, 2023 11:29
@ivarconr ivarconr merged commit 604ec5a into Unleash:main Aug 23, 2023
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants