Skip to content

Fix: Stack overflow when text editor is too small#599

Open
mgarstenauer wants to merge 1 commit into
AvaloniaUI:masterfrom
garstenauer:fix-stackoverflow-when-too-small
Open

Fix: Stack overflow when text editor is too small#599
mgarstenauer wants to merge 1 commit into
AvaloniaUI:masterfrom
garstenauer:fix-stackoverflow-when-too-small

Conversation

@mgarstenauer

Copy link
Copy Markdown
Contributor

Guard against reentry in Caret.BringIntoView(double border) to prevent stack overflow when the TextEditor is too small.

Fixes #596

I also noticed that the text position is unstable. It scrolls to the top of the line when I press a key, and it scrolls halfway down when I click the mouse. This happens because text input calls BringIntoView(0) and mouse input calls BringIntoView(5). To prevent the text from jumping up and down, I now only add the extra border if there is enough space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.StackOverflowException

1 participant