Skip to content

WebView background color has changed after update, can't override. #34518

@jhastingsiii

Description

@jhastingsiii

Description

The earliest report I have of this issue is from a user from 4 days ago.

Reproduction: https://github.com/jhastingsiii/maui-webview-busted2

This problem has occurred without any code changes. I suspect it came from some Windows Update of some kind. The WebView control now has a black background when in Dark Mode and I can't override it with a BackgroundColor="White" attribute. This has never been an issue before today because its background was always White regardless of the Windows Theme. Since this background color can't be overridden it is a problem for pages with the default black text, which doesn't show up well on a dark background. I have no feasible control over the actual HTML I am displaying in this control.

I am sure that this was considered a bug that the web view had a light background in dark mode that they've fixed, but fixing the bug has now become the issue I laid out above. The issue is compounded by not being able to change the background color myself.

Steps to Reproduce

  1. Run the project in the repo in Dark Mode theme.

Link to public reproduction project repository

No response

Version with bug

10.0.20

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions