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] Negative index validation in TextBoxRegEx #2293

Conversation

Bmartin2013
Copy link

Issue: #
#2221

PR Type

What kind of change does this PR introduce?
Bugfix

What is the current behavior?

This application crashes when you enter [1] [-] [left arrow] [Backspace] in a TextBoxRegEx, and its extensions are TextBoxRegex.ValidationType = "Decimal" and TextBoxRegex.ValidationMode="Dynamic". This happens because when you delete characters, the index goes back one position. When it reaches 0, it will return a negative value that will be passed to the remove call, and therefore, this will cause an exception and the app will break.

screenshot_5

What is the new behavior?

The app won't crash after this key combination.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Barbara Martinez and others added 2 commits July 11, 2018 16:43
@kbrons kbrons merged commit 1169df3 into CommunityToolkit:master Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants