From 1da902fe373a84032e144eea0d00d42fa774e7ea Mon Sep 17 00:00:00 2001 From: hribeiro Date: Fri, 5 Sep 2025 09:19:52 +0200 Subject: [PATCH] feat: expose role prop to Input component for accessibility --- cmdk/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdk/src/index.tsx b/cmdk/src/index.tsx index 3131c7b6..56e6dbff 100644 --- a/cmdk/src/index.tsx +++ b/cmdk/src/index.tsx @@ -785,7 +785,7 @@ const Separator = React.forwardRef((props, forwa * All props are forwarded to the underyling `input` element. */ const Input = React.forwardRef((props, forwardedRef) => { - const { onValueChange, ...etc } = props + const { onValueChange, role = "combobox", ...etc } = props const isControlled = props.value != null const store = useStore() const search = useCmdk((state) => state.search) @@ -807,7 +807,7 @@ const Input = React.forwardRef((props, forwardedRe autoCorrect="off" spellCheck={false} aria-autocomplete="list" - role="combobox" + role={role} aria-expanded={true} aria-controls={context.listId} aria-labelledby={context.labelId}