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(Textarea): resolve row count calculation errors caused by scrollbar #2040

Merged
merged 5 commits into from
Sep 6, 2024

Conversation

Mini-ghost
Copy link

πŸ”— Linked issue

N/A

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

In the current version, <UTextarea> does not close the scrollbar when calculating the number of rows, which causes a slight inaccuracy, resulting in an extra row being added even when there is still enough space.

2024-08-14.6.51.09.mov

This PR attempts to address this by applying overflow: hidden before each row calculation and restoring the original setting afterward. This should help eliminate the minor inaccuracies caused by the scrollbar during the calculation process.

2024-08-14.7.19.07.mov

If there are any aspects that I haven't considered thoroughly, please do let me know. I sincerely appreciate your guidance and assistance.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Mini-ghost Mini-ghost changed the title fix: resolve row count calculation errors caused by scrollbar fix(Textarea): resolve row count calculation errors caused by scrollbar Aug 13, 2024
@benjamincanac benjamincanac requested a review from romhml August 20, 2024 10:47
@romhml
Copy link
Collaborator

romhml commented Aug 31, 2024

Hi! I'm not able to reproduce the original issue, would you mind sharing a small reproduction so I can test these changes?

@Mini-ghost
Copy link
Author

Mini-ghost commented Sep 3, 2024

Minimal Reproduction

I'm sorry, this issue is indeed difficult to reproduce. Could you please follow the steps shown in the video, along with the minimal reproducible test? My computer's interface is in Traditional Chinese, but I believe the settings should be the same.

2024-09-03.6.57.31.mov
  1. Click the Apple (ο£Ώ) symbol in the top-left corner of your Mac's menu bar, then click "System Settings...".
  2. Using the sidebar, scroll down and select "Appearance."
  3. Under the "Show scroll bars" option, click the radio button next to "Always."
  4. Open the minimal reproducible test. Currently, there are only 4 lines of text, but <UTextarea> calculates space for 5 lines.

@romhml
Copy link
Collaborator

romhml commented Sep 3, 2024

Thanks! I was able to reproduce it!

Copy link
Collaborator

@romhml romhml left a comment

Choose a reason for hiding this comment

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

Thanks :)

@romhml romhml mentioned this pull request Sep 6, 2024
7 tasks
@benjamincanac benjamincanac merged commit 8210936 into nuxt:dev Sep 6, 2024
2 checks passed
@benjamincanac
Copy link
Member

Thanks! 😊

binhtranhuu pushed a commit to binhtranhuu/nuxt-ui that referenced this pull request Sep 14, 2024
patrick-hofmann pushed a commit to patrick-hofmann/nuxt-ui that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants