Skip to content

Commit 7d0bd19

Browse files
committed
Fixed ‘Cancel’ button in alphanumeric input
1 parent 389e4fb commit 7d0bd19

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

TOPasscodeViewController/TOPasscodeViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ - (void)layoutAccessoryButtonsForWidth:(CGFloat)width
322322
- (void)accessoryButtonTapped:(id)sender
323323
{
324324
if (sender == self.cancelButton) {
325-
if (self.passcodeView.passcode.length > 0) {
325+
// When entering keyboard input, just leave the button as 'cancel'
326+
if (self.passcodeType != TOPasscodeTypeCustomAlphanumeric && self.passcodeView.passcode.length > 0) {
326327
[self.passcodeView deleteLastPasscodeCharacterAnimated:YES];
327328
[self keypadButtonTapped];
328329
return;

TOPasscodeViewController/Views/Shared/TOPasscodeInputField.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ - (void)setPasscode:(NSString *)passcode animated:(BOOL)animated
193193
if (passcodeIsComplete && self.passcodeCompletedHandler) {
194194
self.passcodeCompletedHandler(_passcode);
195195
}
196+
197+
[self reloadInputViews];
196198
}
197199

198200
- (void)appendPasscodeCharacters:(NSString *)characters animated:(BOOL)animated

0 commit comments

Comments
 (0)