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

ComboBox is now wrapped in horizontal_wrap container #4159

Open
WojciechMula opened this issue Mar 11, 2024 · 0 comments
Open

ComboBox is now wrapped in horizontal_wrap container #4159

WojciechMula opened this issue Mar 11, 2024 · 0 comments
Labels
bug Something is broken

Comments

@WojciechMula
Copy link
Contributor

Describe the bug

When a combo boxes are placed in wrapping container, they do not wrap when the container size shrinks.

To Reproduce
I modified Layout Test from demo app in the following way (just added few buttons and combo boxes):

diff --git a/crates/egui_demo_lib/src/demo/layout_test.rs b/crates/egui_demo_lib/src/demo/layout_test.rs
index a5726c7a..ee04f0a1 100644
--- a/crates/egui_demo_lib/src/demo/layout_test.rs
+++ b/crates/egui_demo_lib/src/demo/layout_test.rs
@@ -180,5 +180,42 @@ fn demo_ui(ui: &mut Ui) {
     let mut dummy = false;
     ui.checkbox(&mut dummy, "checkbox");
     ui.radio_value(&mut dummy, false, "radio");
-    let _ = ui.button("button");
+    let _ = ui.button("button1");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button3");
+
+    let alternatives = ["a", "b", "c", "d"];
+    let mut selected = 2;
+    egui::ComboBox::from_label("combobox1").show_index(
+        ui,
+        &mut selected,
+        alternatives.len(),
+        |i| alternatives[i]
+    );
+
+    let mut selected = 2;
+    egui::ComboBox::from_label("combobox2").show_index(
+        ui,
+        &mut selected,
+        alternatives.len(),
+        |i| alternatives[i]
+    );
+
+    let mut selected = 2;
+    egui::ComboBox::from_label("combobox3").show_index(
+        ui,
+        &mut selected,
+        alternatives.len(),
+        |i| alternatives[i]
+    );
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button2");
+    let _ = ui.button("button3");
 }

Expected behavior
Checkboxes should behave like other widgets.

Screenshots
I recorded the modified demo app: https://youtu.be/O5CnZ1KF8D4

@WojciechMula WojciechMula added the bug Something is broken label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant