Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong handling of menu by list of custom_menu_button #5498

Open
abey79 opened this issue Dec 17, 2024 · 0 comments · May be fixed by #5555
Open

Wrong handling of menu by list of custom_menu_button #5498

abey79 opened this issue Dec 17, 2024 · 0 comments · May be fixed by #5555
Labels
bug Something is broken egui rerun Desired for Rerun.io

Comments

@abey79
Copy link
Collaborator

abey79 commented Dec 17, 2024

When multiple custom_menu_button are vertically aligned and close together, going in one button's menu auto-switch to the menu of the next one instead of letting me interact with the menu's content:

custom-menu-bug.mp4

Repro

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
#![allow(rustdoc::missing_crate_level_docs)] // it's an example

use eframe::egui;

fn main() -> eframe::Result {
    env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).

    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
        ..Default::default()
    };

    eframe::run_simple_native("My egui App", options, move |ctx, _frame| {
        egui::CentralPanel::default().show(ctx, |ui| {
            egui::menu::menu_custom_button(ui, egui::Button::new("BTN"), |ui| {
                ui.button("Hello world");
            });
            egui::menu::menu_custom_button(ui, egui::Button::new("BTN"), |ui| {
                ui.button("Hello world");
            });
        });
    })
}

Step:

  1. click on the top button
  2. attempt to click on the "hello world" button in the menu

Expected: the menu stays open so I can interact with its content
Actual: the menu of the next button shows up by mere moving of the mouse cursor

@abey79 abey79 added bug Something is broken egui rerun Desired for Rerun.io labels Dec 17, 2024
@abey79 abey79 added this to the Next Patch Release milestone Dec 17, 2024
@M4tthewDE M4tthewDE linked a pull request Jan 1, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken egui rerun Desired for Rerun.io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant