Skip to content

Commit

Permalink
Web: don't overwrite cursor with CursorIcon::Default
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jun 11, 2024
1 parent 9522670 commit de4adac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ changelog entry.

- On Web, fix `EventLoopProxy::send_event()` triggering event loop immediately
when not called from inside the event loop. Now queues a microtask instead.
- On Web, stop overwriting default cursor with `CursorIcon::Default`.

### Removed

Expand Down
6 changes: 5 additions & 1 deletion src/platform_impl/web/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ impl Inner {
match &self.cursor {
SelectedCursor::Icon(icon)
| SelectedCursor::Loading { previous: Previous::Icon(icon), .. } => {
self.style.set("cursor", icon.name())
if let CursorIcon::Default = icon {
self.style.remove("cursor")
} else {
self.style.set("cursor", icon.name())
}
},
SelectedCursor::Loading { previous: Previous::Image(cursor), .. }
| SelectedCursor::Image(cursor) => {
Expand Down

0 comments on commit de4adac

Please sign in to comment.