You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when using a combobox in a menu button it doesn't work :/
also clicking buttons makes the dialog close normally but that's covered in #335
To Reproduce
Steps to reproduce the behavior:
compile this with eframe as a dependency (just a quick test thing i made not the use case)
fnmain() -> Result<(), eframe::Error>{letmut list:Vec<String> = Vec::new();letmut index = None;
eframe::run_simple_native("combo test",Default::default(),move |ctx, _| {use eframe::egui;
egui::CentralPanel::default().show(ctx, |ui| {letmut show_combo = |ui:&mut egui::Ui| {
ui.horizontal(|ui| {letmut remove_at = None;
egui::ComboBox::from_id_source("select").width(125.0).selected_text(match index {// for some reason this is necessarySome(i) => &list[i]as&str,None => "none",}).show_ui(ui, |ui| {if ui.selectable_label(index.is_none(),"none").clicked(){
index = None;}for(i, pak)in list.iter().enumerate(){
ui.horizontal(|ui| {if ui.selectable_label(index == Some(i), pak).clicked(){
index = Some(i);}if ui.button("x").clicked(){
remove_at = Some(i);if index == remove_at {
index = None}if index.is_some_and(|index| index > i){
index.as_mut().map(|i| *i -= 1);}}});}});ifletSome(i) = remove_at {
list.remove(i);}if ui.button("+").clicked(){
list.push("test".to_string())}})};show_combo(ui);
ui.menu_button("test", show_combo);});})}
Expected behavior
selecting something in the first combobox works fine while selecting something in the menu button combobox does nothing and the selected is the same
the same for clicking the remove button
Desktop (please complete the following information):
OS: windows
Version: 10
The text was updated successfully, but these errors were encountered:
Describe the bug
when using a combobox in a menu button it doesn't work :/
also clicking buttons makes the dialog close normally but that's covered in #335
To Reproduce
Steps to reproduce the behavior:
compile this with eframe as a dependency (just a quick test thing i made not the use case)
Expected behavior
selecting something in the first combobox works fine while selecting something in the menu button combobox does nothing and the selected is the same
the same for clicking the remove button
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: