forked from JedWatson/react-select
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomInput.tsx
More file actions
27 lines (25 loc) · 710 Bytes
/
CustomInput.tsx
File metadata and controls
27 lines (25 loc) · 710 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
import React from 'react';
import Tooltip from '@atlaskit/tooltip';
import Select, { components, InputProps } from 'react-select';
import { ColourOption, colourOptions } from '../data';
const Input = (props: InputProps<ColourOption, true>) => {
if (props.isHidden) {
return <components.Input {...props} />;
}
return (
<div style={{ border: `1px dotted ${colourOptions[2].color}` }}>
<Tooltip content={'Custom Input'}>
<components.Input {...props} />
</Tooltip>
</div>
);
};
export default () => (
<Select
closeMenuOnSelect={false}
components={{ Input }}
defaultValue={[colourOptions[4], colourOptions[5]]}
isMulti
options={colourOptions}
/>
);