emilk / emilk/egui

Menu Button closes submenu when tapped on mobile

Open
#2,785 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

Describe the bug
When deployed to mobile, Image Menu Button & Menu Button close when a user interacts (via a tap) with the submenu.

To Reproduce
Steps to reproduce the behaviour:

  1. Open a menu button on a mobile device
  2. Tap on the submenu

Expected behavior
I expect the submenu to stay open when directly tapped. Instead it instantly closes, even when interacting with ui elements such as a button.

Additional context
I believe the direct cause of this problem is line 648 in menu. It currently uses pointer.hover_pos() instead pointer.interact_pos() which would should keep track of a previous touch input as per the documentation in PointerState

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with line 648 in menu.rs and compare its use of pointer.hover_pos() with pointer.interact_pos(), using the linked PointerState documentation for touch behavior. Reproduce the menu interaction on a mobile device; done means tapping or interacting with submenu UI elements leaves the submenu open.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.