Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
493b3b8
Rename autosize "Input" references to "AutosizeInput"
Aeon Sep 1, 2016
f492e6d
Added arrowRenderer prop and updated examples. Also added an example …
bvaughn Sep 4, 2016
8a08f73
Merge pull request #1191 from JedWatson/1176
bvaughn Sep 4, 2016
2a7e48a
Merge pull request #1186 from Aeon/patch-1
JedWatson Sep 5, 2016
33f528f
Minor whitespace fix
JedWatson Sep 5, 2016
4714955
Adding copyright header to src
JedWatson Sep 5, 2016
6d387d8
Vertical align variables
Calvein Sep 6, 2016
3554c10
Vertical align variables
Calvein Sep 6, 2016
fa569e1
Merge pull request #1193 from Calvein/patch-1
JedWatson Sep 6, 2016
17a3e5d
Do not focus and open menu when disabled
nhducit Sep 10, 2016
cf76d95
Document promptTextCreator property of Creatable.
rubencodes Sep 10, 2016
a863d15
Creatable and Async components can compose each other
bvaughn Sep 11, 2016
e6515ed
Merge pull request #1206 from rubencodes/promptTextCreator-documentation
JedWatson Sep 11, 2016
e62dd0a
Merge pull request #1205 from nhducit/master
JedWatson Sep 11, 2016
8ddc5f2
Merge pull request #1207 from JedWatson/1200
JedWatson Sep 11, 2016
d977fb1
Updating dependencies
JedWatson Sep 11, 2016
f723189
Updating build
JedWatson Sep 11, 2016
3ae25c3
Introducing new AsyncCreatable HOC
bvaughn Sep 12, 2016
019f660
Added super basic test for AsyncCreatable
bvaughn Sep 12, 2016
79ffa35
Added a test for updated filterOptions
bvaughn Sep 12, 2016
5d781bc
Updated GithubUsers (Async demo) to also demo AsyncCreatable
bvaughn Sep 13, 2016
feb70e4
Added check against restoring an invalid cached options
bvaughn Sep 13, 2016
3a5c5ed
Tidied up comments
bvaughn Sep 13, 2016
f77fb2e
Added AsyncCreatable to README
bvaughn Sep 13, 2016
d09a267
Merge pull request #1210 from JedWatson/1200-continued
bvaughn Sep 13, 2016
051bf7d
Added check for invalid filterOptions return value to Creatable
bvaughn Sep 13, 2016
8362f8b
Merge pull request #1213 from JedWatson/pr-987-alt
bvaughn Sep 13, 2016
9eedd5f
Merge JedWatson/react-select#1207 into react-select-plus
Oct 25, 2016
fb9da64
Merge JedWatson/react-select#1213 into react-select-plus
Oct 25, 2016
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
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ It decorates a `Select` and so it supports all of the default properties (eg sin
The easiest way to use it is like so:

```js
import { Creatable } from 'react-select';
import { Creatable } from 'react-select-plus';

function render (selectProps) {
return <Creatable {...selectProps} />;
Expand All @@ -209,10 +209,31 @@ function render (selectProps) {

Property | Type | Description
:---|:---|:---
`children` | function | Child function responsible for creating the inner Select component. This component can be used to compose HOCs (eg Creatable and Async). Expected signature: `(props: Object): PropTypes.element` |
`isOptionUnique` | function | Searches for any matching option within the set of options. This function prevents duplicate options from being created. By default this is a basic, case-sensitive comparison of label and value. Expected signature: `({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean` |
`isValidNewOption` | function | Determines if the current input text represents a valid option. By default any non-empty string will be considered valid. Expected signature: `({ label: string }): boolean` |
`newOptionCreator` | function | Factory to create new option. Expected signature: `({ label: string, labelKey: string, valueKey: string }): Object` |
`promptTextCreator` | function | Creates prompt/placeholder option text. Expected signature: `(filterText: string): string`
`shouldKeyDownEventCreateNewOption` | function | Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option. ENTER, TAB and comma keys create new options by dfeault. Expected signature: `({ keyCode: number }): boolean` |
`promptTextCreator` | function | Factory for overriding default option creator prompt label. By default it will read 'Create option "{label}"'. Expected signature: `(label: String): String` |

### Combining Async and Creatable

Use the `AsyncCreatable` HOC if you want both _async_ and _creatable_ functionality.
It ties `Async` and `Creatable` components together and supports a union of their properties (listed above).
Use it as follows:

```jsx
import React from 'react';
import { AsyncCreatable } from 'react-select-plus';

function render (props) {
// props can be a mix of Async, Creatable, and Select properties
return (
<AsyncCreatable {...props} />
);
}
```

### Filtering options

Expand Down Expand Up @@ -307,6 +328,7 @@ function onInputKeyDown(event) {
Property | Type | Default | Description
:-----------------------|:--------------|:--------------|:--------------------------------
addLabelText | string | 'Add "{label}"?' | text to display when `allowCreate` is true
arrowRenderer | func | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown })`
autoBlur | bool | false | Blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices
autofocus | bool | undefined | autofocus the component on mount
autoload | bool | true | whether to auto-load the default async options set
Expand Down
Loading