Skip to content

Unable to autofill code with sms code #25

Closed
@matanelgabsi

Description

@matanelgabsi

Hi there,
First of all - Love your work. This library saved me a lot of time :)
I currently have an issue with it - when I try to "paste" a code using the SMS code autocomplete (when you receive a code via SMS, and you can press on in like other auto complete suggestions), I get the wrong code.
Tried to debug it a bit, and it seems that handlerOnChangeText receives the code one char at a time, but as a whole. for example, if the code is 123456. then the text will be 1 for the first time, 12 for the second, 123 for the third etc.
As a workaround, I've changed text = text[0]; to text = text[text.length - 1]; (and changed maxLength to code length) but this is probably not the best idea..
BTW, tried canPasteCode but as you can understand it didn't solve the issue.
Any ideas?

Thanks!

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