Context menu for first element in a horizontal_wrapping layout doesn't open
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
Self contained example with eframe:
```Rust
use eframe::{egui, NativeOptions};
struct App {}
impl eframe::App for App {
fn update(&mut self, ctx: &eframe::egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.horizontal_wrapped(|ui| {
for _ in 0..100 {
ui.link("Right click me").context_menu(|ui| {
if ui.button("Hello world!").clicked() {
ui.close_menu();
}
});
}
});
});
}
}
fn main() {
eframe::run_native(
"Test app",
NativeOptions::default(),
Box::new(|_| Box::new(App {})),
).unwrap();
}
```
The context menu doesn't open for these links:

eframe 0.21.3
egui 0.21.0
#2962 might be related.
Contributor guide
Research direction
Run the self-contained eframe example and compare the first link with later links in the horizontal_wrapped layout. Start by tracing horizontal_wrapped and context_menu behavior, and check the related #2962 issue. Done means the context menu opens for the first element and the behavior is covered by a regression test.
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