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 noticed that all keydown events under Command.Root are managed under the onKeyDown event of Command.Root. I'm curious why the scope of the event isn't separately defined in this case.
In my situation, I added a custom component under Command.Root, which is not one of the components provided by 'cmdk'. Even when the custom element is focused, I noticed that focus-roving and item selection events behave the same way, and that's why I have this question.
onKeyDown={(e)=>{etc.onKeyDown?.(e)// But we may need to validate all custom attributes with the 'cmdk' prefix.if(e.targetinstanceofHTMLElement&&e.target.hasAttribte('cmdk-...')){// block focus-roving and select}if(!e.defaultPrevented){
...
}}
import*asPopoverfrom'@radix-ui/react-popover'return(<Popover.Root><Popover.Trigger>Toggle popover</Popover.Trigger><Popover.Content><Command><Command.Input/><Command.List><Command.Item>Apple</Command.Item></Command.List>{/** I can reach the button via Tab, but I want to block events like Keyboard Up/Down, Enter, and other events that propagate. */}<CustomElement><Button>Footer button</Button><CustomElement/></Command></Popover.Content></Popover.Root>
)
The text was updated successfully, but these errors were encountered:
Hello, I am using 'cmdk' quite well.
I noticed that all keydown events under
Command.Root
are managed under the onKeyDown event ofCommand.Root
. I'm curious why the scope of the event isn't separately defined in this case.In my situation, I added a custom component under
Command.Root
, which is not one of the components provided by 'cmdk'. Even when the custom element is focused, I noticed that focus-roving and item selection events behave the same way, and that's why I have this question.The text was updated successfully, but these errors were encountered: