-
Notifications
You must be signed in to change notification settings - Fork 677
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 adds new line everytime we use SetText #1941
Comments
This seems like an issue with the RichEditBox control: https://stackoverflow.com/questions/52689533/duplicating-uwp-richeditbox-content-adds-extra-lines Maybe this issue should be moved to WinUI repo ? |
Agreed and done. |
The worst part is that this is done asynchronously and so There is a similar problem with |
@sharpninja let me understand there are two issues, can you confirm?
|
I think these behaviors should apply to all controls. Instead of manipulating the text to be friendly with the renderers, update the renderers to work with the various line-end formats. |
Is there any more current status regarding this issue? |
This works for me: instead of TextSetOptions.FormatRtf, use combined flags:
One thing ApplyRtfDocumentDefaults will alter the RTF control data (the defaults) the first time. But no extra EOP. |
Thank you @terrycox for the hack. I was going crazy that calling this produced a different text2: RichEditBox.Document.GetText(TextGetOptions.FormatRtf, out string text); All these bugs that will probably never fixed are due to the fact that the WinDev team is so busy recreating the new framework/SDK (WinUI - WinAppSDK) |
I'm writing an app with the WinUI3 (WinAppSDK) and I can confirm this problem exists there too. The legacy continues. |
Describe the bug
Everytime I use
SetText(TextSetOptions.FormatRtf, rtftext)
it adds a new line at the end.Steps to reproduce the bug
Steps to reproduce the behavior:
RichEditBox.Document.SetText(TextSetOptions.FormatRtf, rtfText)
RichEditBox.Document.GetText(TextSetOptions.FormatRtf, out result)
just to see the final result.Expected behavior
No new line should be added to the document.
Actual behavior
A new line is added at the end.
Examples
Original RTF Document:
RTF Document after using GetText():
Version Info
Microsoft.NETCore.UniversalWindowsPlatform v.6.2.9
Microsoft.UI.XAML v.2.3.191211002
Windows 10 version:
Device form factor:
Example Code
App.xaml
App.xaml.cs
The text was updated successfully, but these errors were encountered: