Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputOTP Placeholders #49

Open
almond5 opened this issue May 10, 2024 · 1 comment
Open

InputOTP Placeholders #49

almond5 opened this issue May 10, 2024 · 1 comment
Labels
invalid This doesn't seem right

Comments

@almond5
Copy link

almond5 commented May 10, 2024

Is there no support for placeholders on each InputOTPSlot or the whole InputOTPGroup?
image

@almond5 almond5 added the invalid This doesn't seem right label May 10, 2024
@almond5 almond5 changed the title [DX/UX] InputOTP Placeholders May 10, 2024
@guilhermerodz
Copy link
Owner

Hey @almond5 thanks for opening this issue.

I totally forgot implementing a good DX for the placeholder option.

There's a workaround for rendering that placeholder, but that's logical and not ideal. However, as a workaround, you may be able to check if the placeholder is active by checking isPlaceholderActive = value.length === 0 && placeholder !== null. Then, you should be able to render only the placeholder[slotIdx] and style it as you wish.

I should definitely add a feature around this. There's currently no direct support to placeholder. I am now considering creating a feature for that.

Again, thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants