Repository navigation
Description
Current behavior 🐛
Text wrapping does not work correctly for TextBox, RichEditBox, and TextBlock controls placed within PivotItem content on Desktop (Skia) and WASM platforms. Text extends beyond the visible area horizontally instead of wrapping, even when TextWrapping="Wrap" and MaxWidth properties are set. The same XAML content works correctly when using TabView instead of Pivot.
Important: This issue does NOT occur on WinAppSDK head - it's specific to Desktop/Skia and WASM heads.
This issue was discovered while developing [StoryCAD](https://github.com/storybuilder-org/StoryCAD) on the Desktop head (net9.0-desktop) for cross-platform support, where switching from Pivot to TabView immediately resolved all text wrapping issues without any other code changes.
Expected behavior 🎯
Text content within Pivot control should wrap correctly, respecting TextWrapping="Wrap" and MaxWidth properties, the same way it does in TabView and other container controls.
How to reproduce it (as minimally and precisely as possible) 🔬
Minimal Repro Project
See attached files in /text-wrapping-issue/ folder:
PivotTextWrappingIssue.xaml- Demonstrates the issueTabViewTextWrappingCorrect.xaml- Shows correct behavior with TabViewMainPage.xaml- Allows switching between both examples
Steps to Reproduce
- Create a new UNO Platform application targeting Desktop (net9.0-desktop)
- Add a Pivot control with multiple PivotItems
- Place TextBox controls with
TextWrapping="Wrap"andMaxWidth="600"in PivotItems - Add long text content that should wrap
- Run on Desktop/Skia platform:
dotnet run -f net9.0-desktop - Observe that text does not wrap and extends horizontally beyond boundaries
- Replace Pivot with TabView and observe correct wrapping behavior
Example XAML (Simplified)
Workaround 🛠️
Replace Pivot control with TabView, which handles text wrapping correctly. This is a complete solution for most use cases, as TabView provides a similar tabbed interface.
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
Desktop (macOS)
Uno.Sdk version (and other relevant versions) 📦
6.3.28
IDE version 🧑💻
No response
Anything else we need to know? 💬
Root Cause Analysis
The issue appears to be related to the Pivot control template's use of ScrollViewer around the entire content area. The template contains:
<ScrollViewer x:Name="ScrollViewer"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollMode="Disabled"
VerticalScrollBarVisibility="Disabled">
<!-- Content with measurement issues -->
</ScrollViewer>This is likely a consequence of the workaround for issue #3596 (PivotPanel only shows one header), where a Grid is used inside ScrollViewer instead of the proper PivotPanel:
<!--UNO TODO: Replace with PivotPanel, when header bug is fixed https://github.com/unoplatform/uno/issues/3596-->
<Grid x:Name="Panel" VerticalAlignment="Stretch">Related Issues
- Issues regarding Pivot control #5144 - Issues regarding Pivot control (binding and display issues)
PivotPanelinPivotonly shows one header #3596 - PivotPanel in Pivot only shows one header (preventing proper template implementation)
Activity
Pivot#21080github-actions commentedon May 17, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
github-actions commentedon Sep 16, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
github-actions commentedon Sep 26, 2026
This issue was closed because it had no activity for 10 days after being marked as stale. If you believe this is still relevant, feel free to reopen it or open a new issue with updated context.
MartinZikmund commentedon Oct 9, 2026
Reopening - this still reproduces on current master (Uno.Sdk 7.0 dev, Skia desktop), it was only closed by the stale bot.
Root cause: Uno's
Pivottemplate wraps the items inScrollViewer x:Name="ScrollViewer"(HorizontalScrollBarVisibility="Hidden"), so everything inside it is measured with infinite width, and its direct child is a plain<Grid x:Name="Panel">. WinUI uses<PivotPanel x:Name="Panel">there (controls/dev/CommonStyles/Pivot_themeresources.xaml), andPivotPanel::MeasureOverrideImpl(dxaml/phone/lib/PivotPanel_Partial.cpp) measuresPivotLayoutElementwith the Pivot's section width (set fromPivot::MeasureOverridethroughPivotStateMachine::MeasureEvent->SetSectionWidth), "to lay out the PivotItems with a fixed size, even though we're in a ScrollViewer that will measure with infinite extents".Without that, a
TextBlock/RichTextBlock/TextBoxwithTextWrapping="Wrap"inside aPivotItem(directly, or insideScrollViewer > StackPanel) gets an infinite measure width, reports its unwrapped width asDesiredSizeand is clipped. Example: in an 860-wide window the text'sDesiredSize.Widthis 860 (the single line) regardless of the Pivot's width.Minimal repro:
Expected (WinUI): the text wraps to the Pivot's width. Actual (Uno Skia): one long line, clipped.
Working on a fix that ports
PivotPanel's measure/arrange and uses it in the template, as WinUI does (also relevant to #3596).fix(pivot): Measure PivotItem content with the Pivot's width