Browse Source

Merge pull request #4547 from AvaloniaUI/fixes/textbox-disable-commands-when-pwdbox

Fixes/textbox disable commands when pwdbox
debug/skia-sharp-vmem
danwalmsley 6 years ago
committed by GitHub
parent
commit
cd5d3da18b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/Avalonia.Controls/TextBox.cs

6
src/Avalonia.Controls/TextBox.cs

@ -456,9 +456,9 @@ namespace Avalonia.Controls
private void UpdateCommandStates()
{
var text = GetSelection();
var isNullOrEmpty = string.IsNullOrEmpty(text);
CanCopy = !isNullOrEmpty;
CanCut = !isNullOrEmpty && !IsReadOnly;
var isSelectionNullOrEmpty = string.IsNullOrEmpty(text);
CanCopy = !IsPasswordBox && !isSelectionNullOrEmpty;
CanCut = !IsPasswordBox && !isSelectionNullOrEmpty && !IsReadOnly;
CanPaste = !IsReadOnly;
}

Loading…
Cancel
Save