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

Nathalia make blue square description box bigger and auto-fit #2333

Conversation

nathcarnevalli
Copy link
Contributor

Description

image

Related PRS (if any):

This frontend PR is related to the dev backend PR.

Main changes explained:

  • Created a function called adjustTextareaHeight which adjusts the height of the textarea dynamically based on its scroll height, ensuring it grows to fit the content as the user types.
  • Set the minimum height of the textarea to 200 pixels to ensure it is taller by default, and added overflow hidden.

How to test:

  1. Check into current branch.
  2. Do npm install and npm run start:local to run this PR locally.
  3. Clear site data/cache.
  4. Log as admin/owner user.
  5. Go to Dashboard→ User Profile→Blue Squares→Select a blue square (to edit or add a new one).
  6. Ensure that the default height of the input field for the summary is 4x taller than before.
  7. Add some text to the summary field and verify that the height of the field expands dynamically to fit the content.

Screenshots or videos of changes:

HGN.APP.-.Google.Chrome.2024-06-07.18-57-36.mp4

Note:

...

@nathcarnevalli nathcarnevalli added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Jun 7, 2024
Copy link
Contributor

@jennZhang93 jennZhang93 left a comment

Choose a reason for hiding this comment

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

Tested with owner account. Input field is 4x taller than before, and will auto fit when more lines of inputs are added. Good work!
image

@nishithaShetty
Copy link

Hi Nathalia, Good Work!
The functionality works as expected. The summary textbox is bigger than the original textbox. The textbox auto-adjusts its length to the contents added.
Attached the screenshots below.

PR#2333_1 PR#2333_2

@@ -142,6 +143,11 @@ const UserProfileModal = props => {
}
}

const adjustTextareaHeight = (textarea) => {
textarea.style.height = 'auto';
textarea.style.height = `${textarea.scrollHeight}px`;

Choose a reason for hiding this comment

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

Hi Nathalia,
Everything looks good in the codebase but I would like to highlight that you are simply overwriting the same property on line 147 and 148. It will be better to get rid of the line 147 as it serves no purpose here.
Please let me know if I have interpreted it wrongly.
Thanks!

Copy link

@tianyangL11 tianyangL11 left a comment

Choose a reason for hiding this comment

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

When the content I enter changes, the height of the columns automatically adapts to the change in content, as shown here. Very nice!
969764ef4460db80898a4a3683f8ce4

Copy link

@Parth-tech Parth-tech left a comment

Choose a reason for hiding this comment

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

Hi Nathalia,
I have review your PR and the everything looks great. I have left a comment highlight a redundant code. The PR meets it's required functionality criteria i.e. the description text box for the blue square resizes itself to fit the entire text.
Screenshot 2024-06-07 at 8 08 56 PM
Screenshot 2024-06-07 at 8 08 41 PM

Copy link

@cecilia-uu cecilia-uu left a comment

Choose a reason for hiding this comment

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

Good job! It works as you mentioned.
截屏2024-06-08 下午9 35 52

Copy link
Contributor

@jinxyou jinxyou left a comment

Choose a reason for hiding this comment

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

I checked the blue badge input field height. It seems the height and the auto-fit works fine. Great work!
Screenshot 2024-06-08 164123
Screenshot 2024-06-08 164145

@Logeshwari-Renu Logeshwari-Renu self-requested a review June 8, 2024 22:45
Copy link
Contributor

@Logeshwari-Renu Logeshwari-Renu left a comment

Choose a reason for hiding this comment

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

I have tested the PR and on editing summary field the height of text box expands dynamically to fit the content. Great Work!

PR2333
PR2333_1

Copy link
Contributor

@shradac shradac left a comment

Choose a reason for hiding this comment

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

Good job! The size of the Summary text box increases dynamically to fit the content.

week1-4

@one-community
Copy link
Member

Thank you all, merging!

@one-community one-community merged commit d482eb5 into development Jun 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants