diff --git a/src/App/Pages/Vault/AddEditPage.xaml b/src/App/Pages/Vault/AddEditPage.xaml index 8df6d74fa..8937b5375 100644 --- a/src/App/Pages/Vault/AddEditPage.xaml +++ b/src/App/Pages/Vault/AddEditPage.xaml @@ -68,6 +68,7 @@ Text="{u:I18n Name}" StyleClass="box-label" /> @@ -77,6 +78,7 @@ Text="{u:I18n Username}" StyleClass="box-label" /> @@ -97,6 +99,7 @@ Grid.Row="0" Grid.Column="0" /> @@ -167,6 +172,7 @@ Text="{u:I18n Number}" StyleClass="box-label" /> @@ -196,6 +202,7 @@ Text="{u:I18n ExpirationYear}" StyleClass="box-label" /> @@ -215,6 +222,7 @@ Grid.Row="0" Grid.Column="0" /> @@ -254,6 +263,7 @@ Text="{u:I18n MiddleName}" StyleClass="box-label" /> @@ -262,6 +272,7 @@ Text="{u:I18n LastName}" StyleClass="box-label" /> @@ -270,6 +281,7 @@ Text="{u:I18n Username}" StyleClass="box-label" /> @@ -278,6 +290,7 @@ Text="{u:I18n Company}" StyleClass="box-label" /> @@ -286,6 +299,7 @@ Text="{u:I18n SSN}" StyleClass="box-label" /> @@ -294,6 +308,7 @@ Text="{u:I18n PassportNumber}" StyleClass="box-label" /> @@ -302,6 +317,7 @@ Text="{u:I18n LicenseNumber}" StyleClass="box-label" /> @@ -310,6 +326,7 @@ Text="{u:I18n Email}" StyleClass="box-label" /> @@ -318,6 +335,7 @@ Text="{u:I18n Phone}" StyleClass="box-label" /> @@ -326,6 +344,7 @@ Text="{u:I18n Address1}" StyleClass="box-label" /> @@ -334,6 +353,7 @@ Text="{u:I18n Address2}" StyleClass="box-label" /> @@ -342,6 +362,7 @@ Text="{u:I18n Address3}" StyleClass="box-label" /> @@ -350,6 +371,7 @@ Text="{u:I18n CityTown}" StyleClass="box-label" /> @@ -358,6 +380,7 @@ Text="{u:I18n StateProvince}" StyleClass="box-label" /> @@ -366,6 +389,7 @@ Text="{u:I18n ZipPostalCode}" StyleClass="box-label" /> @@ -374,6 +398,7 @@ Text="{u:I18n Country}" StyleClass="box-label" /> @@ -456,6 +481,7 @@ diff --git a/src/App/Pages/Vault/AddEditPage.xaml.cs b/src/App/Pages/Vault/AddEditPage.xaml.cs index 8b0fba354..d2df07d7d 100644 --- a/src/App/Pages/Vault/AddEditPage.xaml.cs +++ b/src/App/Pages/Vault/AddEditPage.xaml.cs @@ -47,6 +47,62 @@ namespace Bit.App.Pages _identityTitlePicker.ItemDisplayBinding = new Binding("Key"); _folderPicker.ItemDisplayBinding = new Binding("Key"); _ownershipPicker.ItemDisplayBinding = new Binding("Key"); + + _nameEntry.ReturnType = ReturnType.Next; + _nameEntry.ReturnCommand = new Command(() => + { + if(_vm.Cipher.Type == CipherType.Login) + { + _loginUsernameEntry.Focus(); + } + else if(_vm.Cipher.Type == CipherType.Card) + { + _cardholderNameEntry.Focus(); + } + }); + + _loginUsernameEntry.ReturnType = ReturnType.Next; + _loginUsernameEntry.ReturnCommand = new Command(() => _loginPasswordEntry.Focus()); + _loginPasswordEntry.ReturnType = ReturnType.Next; + _loginPasswordEntry.ReturnCommand = new Command(() => _loginTotpEntry.Focus()); + + _cardholderNameEntry.ReturnType = ReturnType.Next; + _cardholderNameEntry.ReturnCommand = new Command(() => _cardNumberEntry.Focus()); + _cardExpYearEntry.ReturnType = ReturnType.Next; + _cardExpYearEntry.ReturnCommand = new Command(() => _cardCodeEntry.Focus()); + + _identityFirstNameEntry.ReturnType = ReturnType.Next; + _identityFirstNameEntry.ReturnCommand = new Command(() => _identityMiddleNameEntry.Focus()); + _identityMiddleNameEntry.ReturnType = ReturnType.Next; + _identityMiddleNameEntry.ReturnCommand = new Command(() => _identityLastNameEntry.Focus()); + _identityLastNameEntry.ReturnType = ReturnType.Next; + _identityLastNameEntry.ReturnCommand = new Command(() => _identityUsernameEntry.Focus()); + _identityUsernameEntry.ReturnType = ReturnType.Next; + _identityUsernameEntry.ReturnCommand = new Command(() => _identityCompanyEntry.Focus()); + _identityCompanyEntry.ReturnType = ReturnType.Next; + _identityCompanyEntry.ReturnCommand = new Command(() => _identitySsnEntry.Focus()); + _identitySsnEntry.ReturnType = ReturnType.Next; + _identitySsnEntry.ReturnCommand = new Command(() => _identityPassportNumberEntry.Focus()); + _identityPassportNumberEntry.ReturnType = ReturnType.Next; + _identityPassportNumberEntry.ReturnCommand = new Command(() => _identityLicenseNumberEntry.Focus()); + _identityLicenseNumberEntry.ReturnType = ReturnType.Next; + _identityLicenseNumberEntry.ReturnCommand = new Command(() => _identityEmailEntry.Focus()); + _identityEmailEntry.ReturnType = ReturnType.Next; + _identityEmailEntry.ReturnCommand = new Command(() => _identityPhoneEntry.Focus()); + _identityPhoneEntry.ReturnType = ReturnType.Next; + _identityPhoneEntry.ReturnCommand = new Command(() => _identityAddress1Entry.Focus()); + _identityAddress1Entry.ReturnType = ReturnType.Next; + _identityAddress1Entry.ReturnCommand = new Command(() => _identityAddress2Entry.Focus()); + _identityAddress2Entry.ReturnType = ReturnType.Next; + _identityAddress2Entry.ReturnCommand = new Command(() => _identityAddress3Entry.Focus()); + _identityAddress3Entry.ReturnType = ReturnType.Next; + _identityAddress3Entry.ReturnCommand = new Command(() => _identityCityEntry.Focus()); + _identityCityEntry.ReturnType = ReturnType.Next; + _identityCityEntry.ReturnCommand = new Command(() => _identityStateEntry.Focus()); + _identityStateEntry.ReturnType = ReturnType.Next; + _identityStateEntry.ReturnCommand = new Command(() => _identityPostalCodeEntry.Focus()); + _identityPostalCodeEntry.ReturnType = ReturnType.Next; + _identityPostalCodeEntry.ReturnCommand = new Command(() => _identityCountryEntry.Focus()); } public bool FromAutofillFramework { get; set; } @@ -61,6 +117,10 @@ namespace Bit.App.Pages { await Navigation.PopModalAsync(); } + else if(!_vm.EditMode) + { + RequestFocus(_nameEntry); + } }); if(_vm.EditMode && Device.RuntimePlatform == Device.Android) {