Hover State for InputOTPSlot #60
Unanswered
joshpalmeroc
asked this question in
Q&A
Replies: 1 comment
-
I guess this is the issue: Workaround: const containerRect = e.currentTarget.getBoundingClientRect()
const clickX = e.clientX - containerRect.left
const slotWidth = containerRect.width / props.maxLength!
const clickedSlotIndex = Math.floor(clickX / slotWidth) Get the client rect and detect which slot is being hovered over. This code snippet is for reference, but you need to configure it based on the mouse hover event. Add the event to the OTPInput. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im trying to change the border color on hover for each InputOTPSlot but for some reason it doesn't work. In my code I have it as "hover:tw-border-hover". I noticed if i go within the browser console and find the specific div and force the state to hover it works just not when i actually mouse over it. I'm thinking maybe it was an intentional design choice or for ada reasons?
Beta Was this translation helpful? Give feedback.
All reactions