-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RichEditBox in UWP/WinUI3 Loses Font Family Settings for Subsequent Lines if the First Line Contains Only a Newline #9757
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you! Open similar issues:
Closed similar issues:
|
@KennethVScom I tried to repro this issue follow the steps in the description but did not reproduce the bug. Would you be able to share a WinUI3 sample app that demonstrates the problem? In the scenario where you are seeing this bug, just calling RichEditBox.Document.GetText() causes the text formatting to disappear - is that correct? |
@kmahone Sorry for the late reply.
Yes, that is correct! Thank you. |
I have similar problems. Selecting last char of the last line also reverts font family to default one: Also, if in a new document you type something and then undo it (leaving the text empty), it also reverts to default font properties: There is a RichEditTextDocument.IgnoreTrailingCharacterSpacing property, but it has no impact whatever it is true or false (if this has something to do with the problem). Its description: Default is false, but the last char is applied. And as mentioned, there is no change if it is set to true or false. Directly using Document.GetText also adds an extra rtf line to the end of the text. But if you set the range of the selection to the entire text and call GetText from that Selection, it gets the text correctly. |
Describe the bug
When using the RichEditBox control in UWP or WinUI3, if the content's first line consists solely of a newline character, the font family settings for subsequent lines are lost after calling the RichEditBox.Document.GetText() method. This results in the text reverting to the default system font family (Segoe UI), rather than retaining the user-defined font family settings.
Steps to reproduce the bug
Expected behavior
The font family settings for all lines, including those following the first newline character, should be preserved after calling the RichEditBox.Document.GetText() method.
Screenshots
NuGet package version
None
Windows version
Windows 11 (22H2): Build 22621, Windows 10 (21H2): Build 19044
Additional context
No response
The text was updated successfully, but these errors were encountered: