Skip to content

Commit

Permalink
Merge pull request JedWatson#2225 from aravindsrivats/master
Browse files Browse the repository at this point in the history
Pass placeholder prop to ValueComponent
  • Loading branch information
JedWatson authored Dec 19, 2017
2 parents 801eb63 + 63dc230 commit f79c0ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/src/components/CustomComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import Gravatar from 'react-gravatar';
const USERS = require('../data/users');
const GRAVATAR_SIZE = 15;

const stringOrNode = PropTypes.oneOfType([
PropTypes.string,
PropTypes.node,
]);

const GravatarOption = createClass({
propTypes: {
children: PropTypes.node,
Expand Down Expand Up @@ -55,7 +60,7 @@ const GravatarOption = createClass({
const GravatarValue = createClass({
propTypes: {
children: PropTypes.node,
placeholder: PropTypes.string,
placeholder: stringOrNode,
value: PropTypes.object
},
render () {
Expand Down
2 changes: 2 additions & 0 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ class Select extends React.Component {
onClick={onClick}
onRemove={this.removeValue}
value={value}
placeholder={this.props.placeholder}
>
{renderLabel(value, i)}
<span className="Select-aria-only">&nbsp;</span>
Expand All @@ -804,6 +805,7 @@ class Select extends React.Component {
instancePrefix={this._instancePrefix}
onClick={onClick}
value={valueArray[0]}
placeholder={this.props.placeholder}
>
{renderLabel(valueArray[0])}
</ValueComponent>
Expand Down

0 comments on commit f79c0ff

Please sign in to comment.