microsoft / microsoft/microsoft-ui-xaml
InlineUIContainers appear in the middle of RichTextBlock if trimmed out with text wrapping disabled
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
Describe the bug
In my app I use InlineUIContainer to display custom emojis in messages.
There are so far no issues when the full message text is displayed, but in some places we need to display it in a single line (replies, chat list...) and there InlineUIContainer elements start to appear in the wrong position.
This only seems to happen when TextWrapping is set to NoWrap. There's a workaround is to leave wrapping enabled and set MaxLines to an appropriate value (that introduces some other issues, by example in the video I use a single RichTextBlock with separate Paragraphs for author name and actual text).
Another issue I encountered in the same scenario is that if the Paragraph begins with an InlineUIContainer the text may trim automatically right after it.
Both issues exist since UWP.
Steps to reproduce the bug
- Create a new
RichTextBlockwithTextWrapping = NoWrapandTextTrimming = CharacterEllipsis. - Add a
Runwith some text long enough to get trimmed, followed by aInlineUIContainer. - Notice the
InlineUIContainerappear on top of text instead of being hidden.
Expected behavior
No response
Screenshots
https://github.com/user-attachments/assets/f0e6aa50-eab8-4ead-a6ed-7535ca44582c
NuGet package version
None
Windows version
No response
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the RichTextBlock reproduction using TextWrapping=NoWrap, TextTrimming=CharacterEllipsis, a long Run, and a following InlineUIContainer. Verify behavior when an InlineUIContainer begins a Paragraph as well. Done means trimmed containers no longer appear over text and leading containers do not cause premature trimming.
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
- 35/100