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

ValidatesOnExceptions=True causes ValidationErrorTemplate to jump around #4120

Closed
pfattisc opened this issue Jun 10, 2021 · 2 comments · Fixed by #4122
Closed

ValidatesOnExceptions=True causes ValidationErrorTemplate to jump around #4120

pfattisc opened this issue Jun 10, 2021 · 2 comments · Fixed by #4122
Labels
Milestone

Comments

@pfattisc
Copy link

Describe the bug

Setting ValidatesOnExceptions=True on a binding causes the ValidationErrorTemplate to jump to the window title in case of exceptions.

Steps to reproduce

  1. Go to the MahAppsDemo project
  2. Add ValidatesOnExceptions=True to the enabled TextBox with ValidationError (that binds to IntegerGreater10Property) on the TextExamples.xaml view. here
  3. Start the demo
  4. Enter the TextBox and provoke an error by hitting the spacebar (entering a space instead of a number).

Expected behavior

The ValidationErrorTemplate should not follow kriss kross and stop jumping around :-P

Possible Fix

I think CustomValidationPopup.ScrollViewer_ScrollChanged is the culprit. The call to RefreshPosition() should be inside of the if-statement that checks whether scrolling actually happened. After I removed that line the jumping stopped. And since the scrollchanged event is fired even if the scrollposition didn't change, I think RefreshPosition() can be safely moved into that if-statement.

Environment

MahApps.Metro version: v2.0.0
Windows build number: Win10 1607
Rider 2021.1.3
Target Framework: .Net v4.7.2

Screenshots

CustomValidationPopup_Bug

@pfattisc pfattisc added the Bug label Jun 10, 2021
@punker76
Copy link
Member

@pfattisc Which MahApps version is this?

@punker76
Copy link
Member

@pfattisc Got it too.

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

Successfully merging a pull request may close this issue.

2 participants