Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Only display error adorner after user interaction.
Browse files Browse the repository at this point in the history
Fixes #307.
  • Loading branch information
grokys committed May 19, 2016
1 parent a10a83c commit 00beae9
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -17,6 +17,7 @@ namespace GitHub.UI
public class ValidationMessage : UserControl
{
const double defaultTextChangeThrottle = 0.2;
bool userHasInteracted;

public ValidationMessage()
{
Expand All @@ -33,7 +34,7 @@ public ValidationMessage()
.Do(CreateBinding)
.Select(control =>
Observable.Merge(
this.WhenAnyValue(x => x.ShowError),
this.WhenAnyValue(x => x.ShowError).Where(x => userHasInteracted),
control.Events().TextChanged
.Throttle(TimeSpan.FromSeconds(ShowError ? defaultTextChangeThrottle : TextChangeThrottle),
RxApp.MainThreadScheduler)
Expand Down Expand Up @@ -121,6 +122,7 @@ public string ErrorAdornerTemplate
void ShowValidateError(bool showError)
{
IsShowingMessage = showError;
userHasInteracted = true;

if (ValidatesControl == null || !IsAdornerEnabled()) return;

Expand Down

0 comments on commit 00beae9

Please sign in to comment.