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

Commit 00beae9

Browse files
committed
Only display error adorner after user interaction.
Fixes #307.
1 parent a10a83c commit 00beae9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/GitHub.UI.Reactive/Controls/Validation/ValidationMessage.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace GitHub.UI
1717
public class ValidationMessage : UserControl
1818
{
1919
const double defaultTextChangeThrottle = 0.2;
20+
bool userHasInteracted;
2021

2122
public ValidationMessage()
2223
{
@@ -33,7 +34,7 @@ public ValidationMessage()
3334
.Do(CreateBinding)
3435
.Select(control =>
3536
Observable.Merge(
36-
this.WhenAnyValue(x => x.ShowError),
37+
this.WhenAnyValue(x => x.ShowError).Where(x => userHasInteracted),
3738
control.Events().TextChanged
3839
.Throttle(TimeSpan.FromSeconds(ShowError ? defaultTextChangeThrottle : TextChangeThrottle),
3940
RxApp.MainThreadScheduler)
@@ -121,6 +122,7 @@ public string ErrorAdornerTemplate
121122
void ShowValidateError(bool showError)
122123
{
123124
IsShowingMessage = showError;
125+
userHasInteracted = true;
124126

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

0 commit comments

Comments
 (0)