Commit bc2d370
Fix sizing bug in
This PR reverts a change introduced in PR
#3660 that caused a regression with
`TextEdit::singleline`. The original PR attempted to fix an issue with
the cursor in `TextEdit` inside `ScrollArea`, but it did so by adding
unnecessary size allocation to `TextEdit`, which breaks the layout when
`TextEdit::singleline` is used outside of `ScrollArea`.

The regression introduced by #3660 is more severe, as it completely
breaks the layout of applications using `TextEdit::singleline`, as shown
in the following issues:
* Closes #5500
* Closes #5597
Furthermore, I was unable to reproduce the original bug from PR #3660 in
the current version of egui using the following code:
```rust
impl eframe::App for MyEguiApp {
fn update(&mut self, ctx: &egui::Context, _: &mut eframe::Frame) {
ctx.set_debug_on_hover(true);
egui::CentralPanel::default().show(ctx, |ui| {
ScrollArea::vertical().max_height(100.0).show(ui, |ui| {
ui.add(TextEdit::multiline(&mut self.text).hint_text("Enter text here..."))
});
});
}
}
```
This code attempts to recreate the layout shown in the video from PR
#3660, using a `ScrollArea` with limited height and a `TextEdit` inside.
However, the cursor hiding issue was not reproducible.

Therefore, I believe the code added in PR #3660 is no longer necessary
and only creates more problems.
* Closes #5500
* Closes #5597
* [x] I have followed the instructions in the PR template
(cherry picked from commit e995c4c)TextEdit::singleline (#5640)1 parent a872446 commit bc2d370
File tree
2 files changed
+13
-10
lines changed- crates
- egui_demo_lib/tests/snapshots/demos
- egui/src/widgets/text_edit
2 files changed
+13
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
740 | 743 | | |
741 | 744 | | |
742 | 745 | | |
| |||
Lines changed: 2 additions & 2 deletions
Loading
0 commit comments