Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing when token is selected now adds input text #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions VENTokenField/VENTokenField.m
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ - (void)layoutInvisibleTextField
[self.invisibleTextField setAutocorrectionType:self.autocorrectionType];
[self.invisibleTextField setAutocapitalizationType:self.autocapitalizationType];
self.invisibleTextField.backspaceDelegate = self;
[self.invisibleTextField addTarget:self action:@selector(invisibleTextFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[self addSubview:self.invisibleTextField];
}

Expand Down Expand Up @@ -451,6 +452,14 @@ - (void)inputTextFieldDidChange:(UITextField *)textField
}
}

- (void)invisibleTextFieldDidChange:(UITextField *)textField
{
_inputTextField.text = [_inputTextField.text?:@"" stringByAppendingString:_invisibleTextField.text];
_invisibleTextField.text = nil;
[_inputTextField becomeFirstResponder];
[self inputTextFieldDidChange:_inputTextField];
}

- (void)handleSingleTap:(UITapGestureRecognizer *)gestureRecognizer
{
[self becomeFirstResponder];
Expand Down