`Interaction::Hovered` never happens on mobile, even when it would make sense.
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.13.1
## System information
iPhone 11 and 15
## Issue
It makes sense that you never "hover" a UI node without pressing it, on mobile, since the position of your finger is tracked only when it touched the screen, but there is one scenario where it would make sense for a UI node entity to have `Interaction::Hovered`.
When you press outside a node, and then slide over it while keeping the mouse pressed, on PC, this node would have a `Interaction::Hovered`. This behavior could be questioned but it makes sense if you compare to the web.
This behavior doesn't happen on mobile though, the node never has the `Interaction::Hovered` component. I think it should.
My guess is it happens because the hover system only checks for cursor position, and there is no cursor position on mobile.
You can go around it by checking where the finger is and then checks if the node is under it but this requires knowing the node's boundaries, which I am not sure are publicly accessible.
### Tangent
If on PC you press on a node and then slide out of it I think it is still marked as `Pressed`, which means if you want to check that the player started pressing on a node and released still on it before doing something, you need to check that it goes from `Pressed` to `Hovered`, which is a bit annoying and doesn't work on mobile either, you also have to know node boundaries for that, and that may also differ from what web browser do?
Maybe there should be a way to check for this kind of interaction? Was a press started on this node? Just released on this node?
Contributor guide
Research direction
Start by locating the systems that produce Interaction::Hovered and handle mobile touch input, then compare their behavior with desktop cursor interaction. The issue provides no file or test names, and its tangent raises broader interaction semantics. Done should include an agreed mobile press-and-slide behavior and regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100