Skip to content

Validation issue with Gboard (and with other 3rd party keyboards) #5

@tevelee

Description

@tevelee

Summary

If users chose to use a custom 3rd party keyboard for interacting with the input field, the validatedFieldBlock will only get called before the last edit.

Example

In case of abcd input the block will call only for a, ab, and abc.
In case of deleting the whole content, the block will call for abcd, abc, ab, a
(always missing the last change)

Workaround

Listening to the UIControlEventEditingChanged notification and calling the validate method once again (after the edit) solves the issue manually, as it triggers firing the validatedFieldBlock.

- ... {
    [textField addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged];
}

- (void)textChanged {
    [textField validate];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions