-
Notifications
You must be signed in to change notification settings - Fork 787
fix(TextBlock): when measuring, always return text size even if bigger than available size on WASM #20442
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
base: master
Are you sure you want to change the base?
fix(TextBlock): when measuring, always return text size even if bigger than available size on WASM #20442
Conversation
…r than available size on WASM
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20442/docs/index.html |
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20442/wasm-skia-net9/index.html |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that on WASM the TextBlock
measurement always reflects its full text size, and adds a UI test to verify overflow behavior.
- Unbounds height (and width when no-wrap) in
MeasureOverride
for WASM to return actual text size. - Adds
When_Text_Does_Not_Fit
test to verify horizontal scrolling when text exceeds bounds. - Imports
Uno.UI.Extensions
in tests for helper methods.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.wasm.cs | Adjust measure logic to unbound height and conditional width for no-wrap |
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBlock.cs | Added new overflow test and required namespace import |
Comments suppressed due to low confidence (1)
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBlock.cs:814
- [nitpick] The variable name
lv
is ambiguous. Consider renaming it tolistView
to improve readability and clarity.
var lv = new ListView()
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBlock.cs
Outdated
Show resolved
Hide resolved
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-20442/docs/index.html |
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-20442/wasm-skia-net9/index.html |
|
GitHub Issue (If applicable): closes https://github.com/unoplatform/kahua-private/issues/289
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):