Combo box tiles are cut off by the scroll bar
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Describe the bug**
When creating a combo box if there are enough items a scroll bar appears. In that case the selectable values get cut off. This issue persists even when `ui.set_min_width()` is called before.
Example code:
```
egui::ComboBox::from_id_source("Task to show: ")
.selected_text(format!("{}", self.chosen_task))
.show_ui(ui, |ui: &mut egui::Ui| {
ui.style_mut().wrap = Some(false);
for task_i in 0..crate::enums::TASKS_NUM {
let task = Task::from_index(task_i);
ui.selectable_value(&mut self.chosen_task, task, format!("{}", task));
}
});
```
The above code produces this (see the grey area with the cut off text for the 3rd item):

Selecting the 3rd item almost fixes the issue:

Calling `ui.set_min_width(400.0);` inside the ComboBox before placing the selectable values just stretches the grey area:

I tried adding a scroll area into the combo box manually, but the issue persists.
Just for reference, this is how the combo box looks with 1 item less, not producing the scroll bar:

**Build information:**
- OS: Windows 10 Pro 22H2
- Application type: Native (.exe)
- Eframe version: 0.22.0
Contributor guide
Research direction
Start by reproducing the example around ComboBox::from_id_source and show_ui with enough selectable values to trigger a scrollbar, using the latest master as requested. Compare the clipped and non-scrolling cases; done means combo-box items remain fully visible when the scrollbar appears, without relying on set_min_width or a manually added scroll area.
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