Skip to content

TreeViewItem selection indicator too short when items are large in height #1711

Description

@superware

Describe the bug

Hello, amazing job on WPF UI.

Found a small but quite disturbing issue with TreeViewItem selection indicator height when items in the tree are relatively large and contain, for example, two lines of text (screenshot follows).

The fix in TreeViewItem.xaml is simple and doesn't break anything:

<Rectangle
	x:Name="ActiveRectangle"
	Grid.Column="0"
	Width="3"
	Margin="0"
	HorizontalAlignment="Left"
	VerticalAlignment="Stretch"
	Fill="{DynamicResource TreeViewItemSelectionIndicatorForeground}"
	RadiusX="2"
	RadiusY="2"
	Visibility="Collapsed" />

Thank you in advance.

To Reproduce

Make items in a TreeView contain two lines of text, and select one of the items.

Expected behavior

The selection indicator should span the entire height of the item.

Screenshots

Image

Should definitely be:
Image

OS version

Windows 10 Pro 22H2 19045.7184

.NET version

8.0

WPF-UI NuGet version

4.3.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions