Skip to content

feat(android): optional clipboard OTP autofill support #254

Description

@Sagniknewme09

Description

On Android, users commonly copy OTP codes from SMS or notifications.
Currently, react-native-confirmation-code-field does not read clipboard content, which forces users to manually type the OTP even when it is already copied.

This results in a UX that differs from standard Android OTP flows and requires app-level workarounds (for example, clipboard polling hooks implemented outside the library).

Expected behavior

When enabled explicitly:

If the clipboard contains a numeric OTP matching cellCount

CodeField should autofill the value

Autofill should:

✅ Work only on Android

✅ Not interfere with manual input

✅ Avoid repeatedly filling the same clipboard value

Current behavior

❌ Clipboard content is ignored

❌ Consumers must implement custom clipboard polling logic outside the library

I already have a working implementation inside CodeField.tsx and can open a PR immediately if this approach and API look acceptable.[

screen-20260210-125701.mp4

](url)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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