microsoft / microsoft/microsoft-ui-xaml

PDF viewer search box has black background in WebView2 hosted in WinUI 3

Open
#11,136 0 comments 0 reactions 0 assignees View on GitHub
area-WebView bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When using WebView2 to preview a PDF inside a WinUI 3 app, the built-in PDF search box is displayed with an abnormal black background in light theme. This makes the search UI difficult to read.

I can also reproduce the issue in WinUI 3 Gallery, so it does not appear to be caused by my own app code.

### Why is this important?

This affects the readability and usability of the built-in PDF search UI in WebView2. Users may not be able to clearly see the search box and search results when viewing PDFs in a WinUI 3 application.

Since the issue can be reproduced in WinUI 3 Gallery, it may affect other WinUI 3 apps that host PDF content through WebView2.

### Steps to reproduce the bug

1. Open WinUI 3 Gallery.
2. Go to Media > WebView2.
3. Open or preview a PDF inside the WebView2 control.
4. Press Ctrl+F or open the built-in PDF search box.
5. Enter any search text.

### Actual behavior

The PDF search box / search popup is displayed with a black background, even though the app is using light theme. The UI becomes hard to read.

### Expected behavior

The PDF search box should match the light theme and remain readable, similar to the behavior in Microsoft Edge.

### Screenshots

Image

### NuGet package version

1.8.251106002

### Windows version

Windows 11 (24H2): Build 26100

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in WinUI 3 Gallery under Media > WebView2 by opening a PDF and using Ctrl+F in light theme. Start by determining whether the black search popup is controlled by the WinUI 3 WebView2 integration or the embedded PDF viewer. Done means the PDF search box and results are readable and match the light theme.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.