Fix regression in TextEdit::singleline layout #5640
+0
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inTextEdit
insideScrollArea
, but it did so by adding unnecessary size allocation toTextEdit
, which breaks the layout whenTextEdit::singleline
is used outside ofScrollArea
.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:Furthermore, I was unable to reproduce the original bug from PR #3660 in the current version of egui using the following code:
This code attempts to recreate the layout shown in the video from PR #3660, using a
ScrollArea
with limited height and aTextEdit
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.