@@ -19,13 +19,25 @@ export interface InputProps {
1919 maxLength ?: number ;
2020 /** width always match content width */
2121 syncWidth ?: boolean ;
22+ /** autoComplete for input */
23+ autoComplete ?: string ;
2224}
2325
2426const Input = React . forwardRef < HTMLInputElement , InputProps > ( ( props , ref ) => {
25- const { onChange, onKeyDown, onBlur, style, syncWidth, value, className, ...restProps } = props ;
27+ const {
28+ onChange,
29+ onKeyDown,
30+ onBlur,
31+ style,
32+ syncWidth,
33+ value,
34+ className,
35+ autoComplete,
36+ ...restProps
37+ } = props ;
2638 const { prefixCls, mode, onSearch, onSearchSubmit, onInputBlur, autoFocus } =
2739 useSelectInputContext ( ) ;
28- const { id, classNames, styles } = useBaseProps ( ) || { } ;
40+ const { id, classNames, styles, open , activeDescendantId } = useBaseProps ( ) || { } ;
2941
3042 const inputCls = clsx ( `${ prefixCls } -input` , classNames ?. input , className ) ;
3143
@@ -121,13 +133,22 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
121133 } as React . CSSProperties
122134 }
123135 autoFocus = { autoFocus }
136+ autoComplete = { autoComplete || 'off' }
124137 className = { inputCls }
125138 value = { value || '' }
126139 onChange = { handleChange }
127140 onKeyDown = { handleKeyDown }
128141 onBlur = { handleBlur }
129142 onCompositionStart = { handleCompositionStart }
130143 onCompositionEnd = { handleCompositionEnd }
144+ // Accessibility attributes
145+ role = "combobox"
146+ aria-expanded = { open || false }
147+ aria-haspopup = "listbox"
148+ aria-owns = { `${ id } _list` }
149+ aria-autocomplete = "list"
150+ aria-controls = { `${ id } _list` }
151+ aria-activedescendant = { open ? activeDescendantId : undefined }
131152 // onMouseDown={onMouseDown}
132153 />
133154 ) ;
0 commit comments