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

MudTextField: Fix scrollbars appearing with AutoGrow on scaled displays due to rounding error #8329

Merged
merged 3 commits into from Mar 15, 2024

Conversation

danielchalmers
Copy link
Contributor

Description

I would notice scrollbars appearing that could barely be moved, specifically on my Android phone with scaling >100%.

Similar fix in #8235 for unrestricted text fields and I believe this PR conclusively fixes it for fields that have MaxLines too.

How Has This Been Tested?

visually

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

scrollHeight is rounded while line-height and others aren't. This causes subpixel inaccuracy resulting in useless scrollbars.

Before:

image

After:

image

Now we don't show a scrollbar at all unless we EXCEED the specified (fractional) max height.

Related:

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Something does not work as intended/expected PR: needs review labels Mar 10, 2024
@danielchalmers
Copy link
Contributor Author

Video2.mp4

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.64%. Comparing base (ac69f55) to head (19e40e1).
Report is 9 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8329      +/-   ##
==========================================
- Coverage   88.65%   88.64%   -0.02%     
==========================================
  Files         407      407              
  Lines       12169    12175       +6     
  Branches     2430     2429       -1     
==========================================
+ Hits        10789    10793       +4     
- Misses        852      853       +1     
- Partials      528      529       +1     

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

@ScarletKuro ScarletKuro requested a review from henon March 10, 2024 11:56
@danielchalmers
Copy link
Contributor Author

Related to AutoGrow: #8234

@henon henon changed the title MudTextField: [AutoGrow] Fix scrollbars appearing on scaled displays due to rounding error MudTextField: Fix scrollbars appearing with AutoGrow on scaled displays due to rounding error Mar 15, 2024
@henon henon merged commit bb0b529 into MudBlazor:dev Mar 15, 2024
3 checks passed
@henon
Copy link
Collaborator

henon commented Mar 15, 2024

Thanks @danielchalmers

@danielchalmers danielchalmers deleted the autogrow0309 branch April 4, 2024 23:44
biegehydra pushed a commit to biegehydra/MudBlazor that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected PR: needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants