Skip to content

Commit

Permalink
fix: always add wrappers to input and suggests
Browse files Browse the repository at this point in the history
  • Loading branch information
ro-ka committed Apr 6, 2016
1 parent dbb5e35 commit 91d1f4f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 31 deletions.
12 changes: 0 additions & 12 deletions README.md
Expand Up @@ -60,18 +60,6 @@ Default: `''`

An initial value for the input, when you want to prefill the suggest.

#### wrapInput
Type: `Boolean`
Default: `false`

Wrap `input` element in a `div` element.

#### wrapSuggestionList
Type: `Boolean`
Default: `false`

Wrap suggestion list (`ul` element) in a `div` element.

#### className
Type: `String`
Default: `''`
Expand Down
4 changes: 1 addition & 3 deletions example/src/app.js
Expand Up @@ -25,9 +25,7 @@ var App = React.createClass({ // eslint-disable-line
onChange={this.onChange}
onSuggestSelect={this.onSuggestSelect}
location={new google.maps.LatLng(53.558572, 9.9278215)}
radius="20"
wrapInput={true}
wrapSuggestionList={true} />
radius="20" />
</div>
);
},
Expand Down
18 changes: 6 additions & 12 deletions src/Geosuggest.jsx
Expand Up @@ -323,18 +323,12 @@ class Geosuggest extends React.Component {
onSuggestSelect={this.selectSuggest.bind(this)}/>;

return <div className={classes}>
{this.props.wrapInput ?
<div className="geosuggest__input-wrapper">
{input}
</div>
: input
}
{this.props.wrapSuggestionList ?
<div className="geosuggest__suggests-wrapper">
{suggestionsList}
</div>
: suggestionsList
}
<div className="geosuggest__input-wrapper">
{input}
</div>
<div className="geosuggest__suggests-wrapper">
{suggestionsList}
</div>
</div>;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/defaults.js
Expand Up @@ -6,8 +6,6 @@ export default {
initialValue: '',
placeholder: 'Search places',
disabled: false,
wrapInput: false,
wrapSuggestionList: false,
className: '',
inputClassName: '',
location: null,
Expand Down
2 changes: 0 additions & 2 deletions src/prop-types.js
Expand Up @@ -8,8 +8,6 @@ export default {
initialValue: React.PropTypes.string,
placeholder: React.PropTypes.string,
disabled: React.PropTypes.bool,
wrapInput: React.PropTypes.bool,
wrapSuggestionList: React.PropTypes.bool,
className: React.PropTypes.string,
inputClassName: React.PropTypes.string,
location: React.PropTypes.object,
Expand Down

0 comments on commit 91d1f4f

Please sign in to comment.