-
-
Notifications
You must be signed in to change notification settings - Fork 489
Expand file tree
/
Copy pathSelectNativeInput.tsx
More file actions
33 lines (29 loc) · 772 Bytes
/
SelectNativeInput.tsx
File metadata and controls
33 lines (29 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import classNames from 'classnames';
import React from 'react';
const visuallyHidden: React.CSSProperties = {
position: 'absolute',
overflow: 'hidden',
width: 1,
height: 1,
border: 0,
margin: -1,
padding: 0,
clip: 'rect(0 0 0 0)',
whiteSpace: 'nowrap',
};
interface SelectNativeInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
prefixCls?: string;
}
export default React.forwardRef<HTMLInputElement, SelectNativeInputProps>(
function SelectNativeInput(props, ref) {
const { prefixCls, className, style, ...rest } = props;
return (
<input
ref={ref}
className={classNames(`${prefixCls}-native-input`, className)}
style={{ ...visuallyHidden, ...style }}
{...rest}
/>
);
},
);