guilhermerodz / input-otp

One time passcode Input. Accessible & unstyled.
https://input-otp.rodz.dev
MIT License
2.5k stars 53 forks source link

input-otp isn't keyboard accessible when used with radix/dialog #59

Closed AayushKarki714 closed 2 months ago

AayushKarki714 commented 3 months ago

Thanks for such an awesome library. I am facing an issue. Why doesn't it work as expected when used within dialog. When input-otp is focused and then I press tab to focus the next interactive element. It skips over the interactive element below it and focuses on the DialogContent.

Here is short demo:

https://github.com/user-attachments/assets/4787751b-f192-438a-87c3-ce7d3cd71877

AayushKarki714 commented 3 months ago

@guilhermerodz can you please help me with this.

guilhermerodz commented 3 months ago

@AayushKarki714 I don't get exactly what this means. The input-otp is a single HTML input, which means pressing tab twice will focus 1. on your OTP input (not per each slot but for the whole input), then will focus 2. on your dialog.

Is that behavior any different when outside of a dialog?

guilhermerodz commented 2 months ago

Closing this issue temporarily while I can't reproduce it locally. Can you provide a CodeSandbox or something like that?