Skip to content

bug: cant paste code into OTP component #4685

Closed

Description

@Mathiu

Reproduction URL (Required)

https://daisyui.com/components/otp/

What version of daisyUI are you using?

v5.7.18

Which browsers are you seeing the problem on?

Firefox

Describe your issue

This might not be a bug but its impossible to paste anything into the otp component which, for me, makes it unusable on mobile. I have also never found a site with OTP without pasting possible.

I didnt find any issue or discussion about it anywhere about this.

I tried a bit to look into it myself but it looks to me like its built in a very hacky way and i dont know if its even possible. I think there has to be an actual input to press but i can see it scales its width to the content.

I can put some more time into it but would love to hear an opinion first, like if its something you would xonsider supporting or how to approach it.

Thank you for your work!

Activity

  1. github-actions commented on Aug 18, 2026

    @github-actions

    Thank you @Mathiu for reporting issues. It helps daisyUI a lot 💚
    I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
    In the meantime providing more details and reproduction links would be helpful.

  2. pdanpdan commented on Aug 18, 2026

    @pdanpdan
    Contributor

    You mean you cannot right-click paste?
    Because all other ways work.

  3. Mathiu commented on Aug 18, 2026

    @Mathiu
    Author

    That is correct, right click paste doesn't work. On mobile, you click on the "input", keyboard show up but not even copyboard suggestions show up and long-click paste does not work either.

    It is working for you in any way?

    edit: I should have mentioned that I test it on Firefox Mobile (Android).

  4. pdanpdan commented on Aug 18, 2026

    @pdanpdan
    Contributor

    Yes. Ok mobile the android keyboard has paste.
    I suppose iOS should have also. When you click the otp you are in an normal input, but without pointer events. Else you could end up in another position than last. You can try to set pointer-events-auto on input and check if it's ok for you

  5. saadeghi commented on Aug 19, 2026

    @saadeghi
    Owner

    When input is clicked, the keyboard opens up, both Android and iOS keyboards have paste button (no need to manually hold the input, open context menu, choose paste).
    And if the input has autocomplete="one-time-code" the keyboard will show the code value from the SMS.

    Please let me know if you have any questions.

  6. Mathiu commented on Aug 19, 2026

    @Mathiu
    Author

    I really appreciate your help.

    Thank you!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions