emilk / emilk/egui

Can't interact with widgets added to layers other than Background

Open
#478 5 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

just change the egui_template code into:

```rs
ui.with_layer_id(egui::LayerId::new(egui::Order::Middle, egui::Id::new("mid")), |ui| {
ui.add(egui::Slider::new(value, 0.0..=10.0).text("value"));
if ui.button("Increment").clicked() {
*value += 1.0;
}
});
```

and the widgets couldn't be interacted with any more. I suppose interactions are allowed in other layers because `egui::LayerId::allow_interaction` returns true? No more info could be found in the doc. It seems to be a bug.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided egui_template example with a widget in a Middle layer, then inspect LayerId::allow_interaction and the surrounding input-handling code. Done means the slider and Increment button remain interactive outside the Background layer, with a regression test or example demonstrating the behavior.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.