WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

Not able to render custom cursor

Open Take-A-Byte opened this issue 2 years ago • 10 comments

Description

If we try to use a custom cursor inside a UWP app, we get a default cursor instead of a specified cursor. It does not even render the fallback cursor.

Version SDK: 1.0.1661.34 Framework: UWP & WinUI3 OS: Win11

Repro Steps

  1. Load local index.html with the following content in a UWP app inside WebView2
<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        html, body {
            width: 100%;
            height: 100%;
        }

        #root {
            width: 100%;
            height: 100%;
            background: aqua;
            cursor: url("circle.ico"), crosshair;
        }
    </style>
</head>
<body>
<div id="root"></div>
</html>

Expected Output Cursor is rendered as circle.ico or crosshair

Actual Output Default cursor is rendered

Additional context If we use cursor: crosshair; instead, the crosshair is rendered

Take-A-Byte avatar Apr 12 '23 15:04 Take-A-Byte

This is an existing issue for WebView2 in UWP apps: #1925. I'm going to make sure we get this listed in our docs for now.

david-risney avatar Apr 17 '23 23:04 david-risney

I've added a section to this doc https://learn.microsoft.com/en-us/microsoft-edge/webview2/get-started/winui2#custom-cursors about custom cursors not working. That doc covers various things that are currently not supported in WebView2 in UWP and that content should be moved in the near future into its own separate doc (its sort of hard to find right now in the Getting Started doc)

david-risney avatar Apr 19 '23 17:04 david-risney

This is helpful! Thanks 🙇

Take-A-Byte avatar Apr 19 '23 18:04 Take-A-Byte

@david-risney I just noticed that cursor: none also does not work. Could you please verify this and add it to the documentation?

Take-A-Byte avatar May 23 '23 06:05 Take-A-Byte

Yes, thanks. Looks like some of the other built-in cursor kinds don't work as well. Like help, wait, crosshair work, but progress, grab, don't. I'll update that, thanks.

david-risney avatar May 23 '23 17:05 david-risney

Thanks 🙇

Take-A-Byte avatar May 24 '23 05:05 Take-A-Byte

Any updates on this issue, facing the same in Blazor Hybrid with .NET 8.

orosbogdan avatar Dec 12 '23 17:12 orosbogdan

is there any way to use custom cursor in webview2?

0exception avatar Jun 28 '24 13:06 0exception

Some of the resize cursors don't work either, for example ew-resize doesn't work, while col-resize does work.

elias-ik avatar Jul 08 '24 08:07 elias-ik

Any updates? Still running into this today...

ChaseIngersol avatar Sep 04 '24 23:09 ChaseIngersol

However, there are still issues

wood4099 avatar Dec 31 '24 07:12 wood4099