Skip to content

Commit 83cd06f

Browse files
committed
chore: more
1 parent 0ed8ae6 commit 83cd06f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SelectInput/Input.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
55
import useBaseProps from '../hooks/useBaseProps';
66

77
export interface InputProps {
8+
id?: string;
89
disabled?: boolean;
910
readOnly?: boolean;
1011
value?: string;
@@ -24,7 +25,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
2425
const { onChange, onKeyDown, onBlur, style, syncWidth, value, className, ...restProps } = props;
2526
const { prefixCls, mode, onSearch, onSearchSubmit, onInputBlur, autoFocus } =
2627
useSelectInputContext();
27-
const { classNames, styles } = useBaseProps() || {};
28+
const { id, classNames, styles } = useBaseProps() || {};
2829

2930
const inputCls = clsx(`${prefixCls}-input`, classNames?.input, className);
3031

@@ -108,6 +109,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
108109
// ============================= Render =============================
109110
return (
110111
<input
112+
id={id}
111113
type={mode === 'combobox' ? 'text' : 'search'}
112114
{...restProps}
113115
ref={inputRef}

0 commit comments

Comments
 (0)