Skip to content

Commit

Permalink
fix(Select): add ability to pass data attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Nov 9, 2018
1 parent 1eb2043 commit ce74988
Show file tree
Hide file tree
Showing 2 changed files with 470 additions and 463 deletions.
28 changes: 17 additions & 11 deletions src/atoms/dataEntry/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type SelectProps = {|
value?: Object,
loading?: boolean,
disabled?: boolean,
multiple?: boolean,
hasError?: boolean,
zIndex?: string | number,
|};
Expand Down Expand Up @@ -43,17 +44,22 @@ const customStyles = ({ hasError, zIndex = Z_INDEX.DROPDOWN }) => ({
}),
});

const Select = ({ loading, disabled, ...props }: SelectProps) => (
<SelectTag
{ ...props }
isClearable={ false }
isLoading={ loading }
isDisabled={ disabled }
tagName={ ReactSelect }
styles={ customStyles(props) }
menuPortalTarget={ document.body }
menuPlacement="auto"
/>
const Select = ({ value, loading, disabled, multiple, options, onChange, placeholder, ...props }: SelectProps) => (
<SelectTag { ...props }>
<ReactSelect
isClearable={ false }
isDisabled={ disabled }
isLoading={ loading }
isMulti={ multiple }
menuPlacement="auto"
menuPortalTarget={ document.body }
onChange={ onChange }
options={ options }
placeholder={ placeholder }
styles={ customStyles(props) }
value={ value }
/>
</SelectTag>
);

export { Select };
Expand Down
Loading

0 comments on commit ce74988

Please sign in to comment.