Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of CoerceCaretIndex on Text change #2553

Merged
merged 4 commits into from
May 28, 2019

Conversation

ahopper
Copy link
Contributor

@ahopper ahopper commented May 20, 2019

What does the pull request do?

fixes exception on clicking in TextBox #2552

What is the current behavior?

Under rare circumstances clicking at the end of a TextBox throws an exception

What is the updated/expected behavior with this PR?

exception free clicking

How was the solution implemented (if it's not obvious)?

The check for \r\n could fail if there was a \r at the end of the Text.
Calls to CoerceCaretIndex were using the previous text on Text changed which I can't believe was intended.

Checklist

Fixed issues

Fixes #2552

@Gillibald
Copy link
Contributor

Can you add a unit tests for this?

Copy link
Member

@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @ahopper !

@grokys grokys merged commit a6586f4 into AvaloniaUI:master May 28, 2019
@ahopper ahopper deleted the fix-textbox-exception-on-click branch June 2, 2019 19:14
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.

TextBox throws exception on PointerPressed
4 participants