Skip to content

TabViewItem Header Text Has Uneven Padding When TabWidthMode="SizeToContent" #10524

@shenxianovo

Description

@shenxianovo

Describe the bug

When setting the TabWidthMode property of a TabView to SizeToContent, the padding between the header text and the left/right edges of the tab becomes uneven. The header text appears closer to the right side, which affects the visual alignment and consistency of the tabs.

<TabView TabWidthMode="SizeToContent">
    <TabViewItem Header="Text" IsClosable="False"/>
    <TabViewItem Header="Text2"/>
</TabView>

Steps to reproduce the bug

  1. Create a TabView, set TabWidthMode="SizeToContent"
  2. Create TabViewItem

Expected behavior

The header text should have equal padding on both the left and right sides of the tab, regardless of the SizeToContent property.

Screenshots

Image

Image

NuGet package version

WinUI 3 - Windows App SDK 1.7.1: 1.7.250401001

Windows version

Windows 11 (23H2): Build 22631

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-TabViewbugSomething isn't workingclosed-FixedDescribed behavior has been fixed.fix-releasedThe fix has been in a release (experimental, preview, stable, or servicing).

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions