Labels drawn inside a Split widget overflow their containers
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
I have some code that creates a split layout:
```
fn ui_builder() -> impl Widget {
Split::horizontal(
Flex::column().with_child(Label::new("Sidebar goes here").center(), 1.),
Flex::column().with_child(Label::new("Task goes here").center(), 1.),
)
.draggable(true)
}
```
If I drag the split handle so that the left side of the `Split` is smaller than the width of the `Label` it contains, the label text overflows its container and into the right side of the split. This is what it looks like:

I can reproduce the same issue by manually setting the size of the `Split`:
```
fn ui_builder() -> impl Widget {
Split::horizontal(
Flex::column().with_child(Label::new("Sidebar goes here").center(), 1.),
Flex::column().with_child(Label::new("Task goes here").center(), 1.),
)
.draggable(true)
.split_point(0.2)
}
```
If I use a `Button` instead of a `Label` as a child, the button resizes itself to fit inside the `Split` as expect. But the text inside the button overflows the `Split` container as well as the button. Here's the code to reproduce the issue:
```
fn ui_builder() -> impl Widget {
Split::horizontal(
Flex::column().with_child(Button::new("Button goes here", Button::noop).center(), 1.),
Flex::column().with_child(Label::new("Task goes here").center(), 1.),
)
.draggable(true)
.split_point(0.2)
}
```
Here's is what it produces:

The issue occurs on the current `master` branch. I haven't had a chance to test it on `0.4`.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the overflow with the Split, Label, and Button examples in the issue, first narrowing the investigation to the widget layout and rendering paths for those components. Verify the behavior while dragging and with split_point(0.2); the issue is done when child text remains within its Split container at narrow sizes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100