Skip to content

Commit

Permalink
Turn off text wrapping by default in combo-box popups (#3912)
Browse files Browse the repository at this point in the history
This trips up a lot of users
  • Loading branch information
emilk authored Jan 29, 2024
1 parent 13b59fb commit 1d1b07c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/egui/src/containers/combo_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,15 @@ fn combo_box_dyn<'c, R>(
|ui| {
ScrollArea::vertical()
.max_height(height)
.show(ui, menu_contents)
.show(ui, |ui| {
// Often the button is very narrow, which means this popup
// is also very narrow. Having wrapping on would therefore
// result in labels that wrap very early.
// Instead, we turn it off by default so that the labels
// expand the width of the menu.
ui.style_mut().wrap = Some(false);
menu_contents(ui)
})
.inner
},
);
Expand Down

0 comments on commit 1d1b07c

Please sign in to comment.