Skip to content

Commit

Permalink
feat(Select): add withPortal flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Apr 22, 2019
1 parent 2d5990b commit 36dbcbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type SelectProps = {|
multiple?: boolean,
clearable?: boolean,
hasError?: boolean,
withPortal?: boolean,
zIndex?: string | number,
valueComponent?: React$Node,
components?: Object,
Expand Down Expand Up @@ -103,6 +104,7 @@ class Select extends React.Component<SelectProps> {
valueComponent,
components,
onChange,
withPortal,
...rest
} = this.props;

Expand All @@ -120,7 +122,7 @@ class Select extends React.Component<SelectProps> {
isLoading={ loading }
isMulti={ multiple }
menuPlacement="auto"
menuPortalTarget={ document.body }
menuPortalTarget={ withPortal ? document.body : false }
onChange={ this.onChange }
options={ options }
placeholder={ placeholder }
Expand Down

0 comments on commit 36dbcbf

Please sign in to comment.