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

[BD-46] fix: add min-height to form.control textarea #2818

Merged

Conversation

khudym
Copy link
Contributor

@khudym khudym commented Nov 16, 2023

Description

Add a min textarea height
Issue#2783

Deploy Preview

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please add wittjeff and adamstankiewicz as reviewers on this PR.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

Copy link

netlify bot commented Nov 16, 2023

Deploy Preview for paragon-openedx ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3e4615b
🔍 Latest deploy log https://app.netlify.com/sites/paragon-openedx/deploys/655c99e396ca150008d2b6da
😎 Deploy Preview https://deploy-preview-2818--paragon-openedx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@openedx-webhooks openedx-webhooks added the blended PR is managed through 2U's blended developmnt program label Nov 16, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @khudym!

When this pull request is ready, tag your edX technical lead.

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (15bf341) 92.89% compared to head (5f9fcd1) 92.83%.
Report is 10 commits behind head on master.

❗ Current head 5f9fcd1 differs from pull request most recent head 3e4615b. Consider uploading reports for the commit 3e4615b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2818      +/-   ##
==========================================
- Coverage   92.89%   92.83%   -0.07%     
==========================================
  Files         235      235              
  Lines        4333     4240      -93     
  Branches     1053     1029      -24     
==========================================
- Hits         4025     3936      -89     
+ Misses        304      300       -4     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@khudym khudym force-pushed the hudym/fix/form-control-textarea-min-height branch from 02cdc51 to d1663ce Compare November 16, 2023 09:59
@@ -46,6 +46,10 @@ $select-icon-padding: .5625rem !default;
flex-grow: 1;
align-items: flex-start;

.form-control {
min-height: 2.75rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

In your proposed implementation, we roughly set the value of the minimum input height with type textarea. This may not display correctly on inputs of different sizes. See what happens if an input with type textarea has different sizes (sm, md, lg):
image

This problem can be solved by using the $input-height variable and its variants for different sizes ($input-height-sm, $input-height-lg), the value of which will depend on the current input parameters (line height, y-axis padding and border height). Take a look please:
image

@viktorrusakov viktorrusakov linked an issue Nov 19, 2023 that may be closed by this pull request
Comment on lines 49 to 60
.form-control {
min-height: $input-height;
}

.form-control-lg {
min-height: $input-height-lg;
}

.form-control-sm {
min-height: $input-height-sm;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me that the option of specifying a minimum height only for the textarea would be better because in your implementation we have a min-height for all .form-controls that do not need it.

Suggested change
.form-control {
min-height: $input-height;
}
.form-control-lg {
min-height: $input-height-lg;
}
.form-control-sm {
min-height: $input-height-sm;
}
textarea {
&.form-control {
min-height: $input-height;
}
&.form-control-lg {
min-height: $input-height-lg;
}
&.form-control-sm {
min-height: $input-height-sm;
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, other types of inputs cannot have problems with height.

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

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

LGTM!

Verified by going to https://paragon-openedx.netlify.app/components/form/form-control/ and resizing the text area to be shorter than the text line height

image

then trying to do the same here https://deploy-preview-2818--paragon-openedx.netlify.app/components/form/form-control/ and not being able to.

@viktorrusakov viktorrusakov merged commit c659cbf into openedx:master Nov 22, 2023
8 checks passed
@openedx-webhooks
Copy link

@khudym 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@openedx-semantic-release-bot

🎉 This PR is included in version 21.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@openedx-semantic-release-bot

🎉 This PR is included in version 22.0.0-alpha.18 🎉

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
blended PR is managed through 2U's blended developmnt program released on @alpha released
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Safari] Textarea no manual height adjusting
6 participants