microsoft / microsoft/microsoft-ui-xaml

TextBlock with IsTextSelectionEnabled=true are not wrapping correctly

Open
#10,392 0 comments 0 reactions 0 assignees View on GitHub
area-TextBlocks bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When selection is enabled, `TextBlock` no longer wrap properly.

### Steps to reproduce the bug

```xml

```

### Expected behavior

_No response_

### Screenshots

![Image](https://github.com/user-attachments/assets/4afd0936-16c2-4877-b9cf-4218c791cf29)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.5: 1.6.250205002

### Windows version

Windows 11 (24H2): Build 26100

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the provided TextBlock XML repro using IsTextSelectionEnabled="True" and TextWrapping="WrapWholeWords" on the listed Windows App SDK version. Investigate the TextBlock selection and wrapping behavior, using the screenshot as the visual reference; done means long text wraps correctly and the selection highlight remains aligned.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.