Browse Source
Merge pull request #6763 from Takoooooo/fix-repeatbutton-focus
Fix RepeatButton keeps sending clicks when focus changed
pull/6776/head
Dan Walmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
0 deletions
-
src/Avalonia.Controls/RepeatButton.cs
|
|
@ -70,6 +70,16 @@ namespace Avalonia.Controls |
|
|
_repeatTimer?.Stop(); |
|
|
_repeatTimer?.Stop(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change) |
|
|
|
|
|
{ |
|
|
|
|
|
base.OnPropertyChanged(change); |
|
|
|
|
|
|
|
|
|
|
|
if (change.Property == IsPressedProperty && change.NewValue.GetValueOrDefault<bool>() == false) |
|
|
|
|
|
{ |
|
|
|
|
|
StopTimer(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected override void OnKeyDown(KeyEventArgs e) |
|
|
protected override void OnKeyDown(KeyEventArgs e) |
|
|
{ |
|
|
{ |
|
|
base.OnKeyDown(e); |
|
|
base.OnKeyDown(e); |
|
|
|