You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have input inside of the Popover.Trigger and when pressing the Space key it triggers the keyboard interactions so I disabled it from the Popover.Trigger but the input inside of the component still fires the interaction and I can't disable pressing Space because duhh it is an input.
Any ideas about how to fix this issue?
I tried controlling the input and slicing but if the cursor is in the middle when pressing space it push the cursor to the end
<PopoverTriggerclassName="relative w-full"><Inputvalue={searchQuery}onChange={(e)=>setSearchQuery(e.target.value)}onKeyDown={(e)=>{constcursorIndex=e.currentTarget.selectionStart;// I have to use this workaround because Radix doesn't support disabling keyboard actions and I have input so disabling the space can't be an optionif(e.key===" "){e.preventDefault();setSearchQuery((prev)=>prev.slice(0,cursorIndex!)+" "+prev.slice(cursorIndex!),);}}}/></PopoverTrigger>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have input inside of the Popover.Trigger and when pressing the Space key it triggers the keyboard interactions so I disabled it from the Popover.Trigger but the input inside of the component still fires the interaction and I can't disable pressing Space because duhh it is an input.
Any ideas about how to fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions