Skip to content

Setting cursor on web applies to <body>, not <canvas> #8035

@mkeeter

Description

@mkeeter

Describe the bug
On the web platform, calling ui.set_cursor_icon(egui::CursorIcon::None) applies a CSS style to the top <body> instead of the target <canvas>.

To Reproduce
Steps to reproduce the behavior:

  1. See the demo here
  2. Move the mouse over the canvas, note that the cursor disappears (because the app draws its own cursor)
  3. Move the mouse to the right of the canvas, note that the cursor remains gone (note that I override the cursor for the footer, so it shows up down there)
  4. In the HTML inspector, note that cursor: none; is applied to the <body>

Expected behavior
The cursor should only be hidden over the canvas

Desktop (please complete the following information):

  • OS: macOS 14
  • Browser: Firefox 148

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions