Set cursor position after toggle password visibility (#1568)

- Lock page
- Login page
- Register page
This commit is contained in:
Jake Fink 2021-10-08 12:09:08 -04:00 committed by GitHub
parent d3734c63fc
commit faac7ebe5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View file

@ -318,6 +318,7 @@ namespace Bit.App.Pages
var page = (Page as LockPage);
var entry = PinLock ? page.PinEntry : page.MasterPasswordEntry;
entry.Focus();
entry.CursorPosition = PinLock ? Pin.Length : MasterPassword.Length;
}
public async Task PromptBiometricAsync()

View file

@ -185,7 +185,9 @@ namespace Bit.App.Pages
public void TogglePassword()
{
ShowPassword = !ShowPassword;
(Page as LoginPage).MasterPasswordEntry.Focus();
var entry = (Page as LoginPage).MasterPasswordEntry;
entry.Focus();
entry.CursorPosition = MasterPassword.Length;
}
}
}

View file

@ -201,13 +201,17 @@ namespace Bit.App.Pages
public void TogglePassword()
{
ShowPassword = !ShowPassword;
(Page as RegisterPage).MasterPasswordEntry.Focus();
var entry = (Page as RegisterPage).MasterPasswordEntry;
entry.Focus();
entry.CursorPosition = MasterPassword.Length;
}
public void ToggleConfirmPassword()
{
ShowPassword = !ShowPassword;
(Page as RegisterPage).ConfirmMasterPasswordEntry.Focus();
var entry = (Page as RegisterPage).ConfirmMasterPasswordEntry;
entry.Focus();
entry.CursorPosition = ConfirmMasterPassword.Length;
}
}
}