Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ReactDOM.render(
<Contributors label="Contributors (Async)" />
<NumericSelect label="Numeric Values" />
<CustomRender label="Custom Render Methods"/>
<CustomComponents label="Custom Option and Value Components" />
<CustomComponents label="Custom Placeholder, Option and Value Components" />
{/*
<SelectedValuesField label="Option Creation (tags mode)" options={FLAVOURS} allowCreate hint="Enter a value that's NOT in the list, then hit return" />
*/}
Expand Down
9 changes: 7 additions & 2 deletions examples/src/components/CustomComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,23 @@ const UsersField = React.createClass({
this.setState({ value });
},
render () {
var placeholder = <span>&#9786; Select User</span>;

return (
<div className="section">
<h3 className="section-heading">{this.props.label}</h3>
<Select
onChange={this.setValue}
optionComponent={GravatarOption}
options={USERS}
placeholder="Select user"
placeholder={placeholder}
value={this.state.value}
valueComponent={GravatarValue}
/>
<div className="hint">This example implements custom Option and Value components to render a Gravatar image for each user based on their email</div>
<div className="hint">
This example implements custom Option and Value components to render a Gravatar image for each user based on their email.
It also demonstrates rendering HTML elements as the placeholder.
</div>
</div>
);
}
Expand Down
5 changes: 4 additions & 1 deletion src/Async.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ const Async = React.createClass({
loadingPlaceholder: React.PropTypes.string, // replaces the placeholder while options are loading
minimumInput: React.PropTypes.number, // the minimum number of characters that trigger loadOptions
noResultsText: React.PropTypes.string, // placeholder displayed when there are no matching search results (shared with Select)
placeholder: React.PropTypes.string, // field placeholder, displayed when there's no value (shared with Select)
placeholder: React.PropTypes.oneOfType([ // field placeholder, displayed when there's no value (shared with Select)
React.PropTypes.string,
React.PropTypes.node
]),
searchingText: React.PropTypes.string, // message to display while options are loading
searchPromptText: React.PropTypes.string, // label to prompt for search input
},
Expand Down