Skip to content

RichEditBox loses font color when switching themes #10935

@tipa

Description

@tipa

Describe the bug

When changing the theme (e.g. from Dark to Light), the foreground color of a text in a RichEditBox "is lost", meaning the color switches back to the default text foreground color

Why is this important?

I am using RichEditBox as a WYSIWYG editor and users can add formatting to the text (bold, italics, background color, foreground colors etc). It can happen that users either manually change the Windows theme in the Windows settings. When this happens, the color formatting gets lost

Steps to reproduce the bug

  1. Download and open WinUI 3 Gallery app
  2. Go to RichEditBox page (winui3gallery://item/RichEditBox)
  3. Focus text field and paste a colored text (e.g. some colored text copied from MS Word):
  4. Click "Toggle Theme"
  5. Note that the text color has changed to either black or white (depending on the theme) and is no longer colored

Actual behavior

Image Image Image

Expected behavior

Image Image Image

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.8.3: 1.8.251106002

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-TextBoxTextBox, RichEditBoxbugSomething isn't working

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions