Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
b894d98
Add undocumented arguments for menuRenderer
juliankrispel Sep 7, 2016
093719b
Fix setting option ref when focused.
piecyk Sep 13, 2016
740bf26
Merge pull request #1196 from juliankrispel/patch-3
bvaughn Sep 13, 2016
b6a6954
Remove unused SCSS mixins
sunny Sep 14, 2016
4d9b3e0
Merge pull request #1219 from sunny/patch-1
JedWatson Sep 15, 2016
f61c4f2
Merge pull request #1211 from piecyk/fix-ref-focused
JedWatson Sep 15, 2016
17d76a4
Add "select all text" functionality Shift+Home|Del
piecyk Sep 15, 2016
15d0bb8
Merge pull request #1221 from piecyk/add-select-all-text
JedWatson Sep 16, 2016
e3fb016
Fixed #546. Added support for boolean values.
Aaronius Sep 16, 2016
c2424c7
Merge pull request #1224 from Aaronius/boolean-values
JedWatson Sep 17, 2016
916ab0e
Updating build
JedWatson Sep 17, 2016
ed8d087
Refactored Async. Cache not yet implemented. Pushing for discussion
bvaughn Sep 18, 2016
b319024
Implemented and tested cache. Also fixed a spacing issue.
bvaughn Sep 18, 2016
3c3e0e5
Fixed .editorconfig tab issue
bvaughn Sep 18, 2016
6cfad88
Fixed 2 of the 3 Promise-based tests
bvaughn Sep 18, 2016
b883344
Resolved failing Async-Promise test
bvaughn Sep 18, 2016
f822236
Added some additional Async tests
bvaughn Sep 18, 2016
c50e47c
Added toggleable backspace removes options to Github demo for Async
bvaughn Sep 18, 2016
64335f8
Merge pull request #1226 from JedWatson/Async-refactor
bvaughn Sep 18, 2016
b5e2bce
Updating build in prop for RC2
bvaughn Sep 18, 2016
2b14448
Udpated package in prep for upcoming RC2
bvaughn Sep 18, 2016
ab14fac
Remove duplicated `promptTextCreator` field in *Creatable properties*
jihchi Sep 22, 2016
ddd1fbc
fix(async): create new cache object for each instance by default
TheSharpieOne Sep 22, 2016
290aa15
Fix for Creatable doesn't allow input key down handling. Issue #1247
Sep 23, 2016
d2ff4a9
Add unit test for fix - Creatable doesn't allow input key down handli…
Sep 23, 2016
b4a3fd1
Merge pull request #1240 from jihchi/patch-1
JedWatson Sep 23, 2016
d5f2ce2
Adding back ref that was removed in rc2
jooj123 Sep 24, 2016
3b7dad8
Merge pull request #1249 from jooj123/patch/add-ref
JedWatson Sep 25, 2016
962f138
Merge pull request #1248 from IvanLeonenko/creatable-input-keys
JedWatson Sep 25, 2016
84c2cc9
Fix typo in README.md
rockingskier Sep 27, 2016
ac6cb94
Add back onInputChange
Sep 28, 2016
2e37a5d
Allow react nodes to be passed as loadingPlaceholder
DanielHeath Sep 29, 2016
0b36224
Merge pull request #1260 from DanielHeath/patch-1
JedWatson Sep 29, 2016
6c5c828
Use attachEvent/detachEvent for IE8 compability
Sep 30, 2016
f9039c7
Remove unit (px) from minWidth attribute
Sep 30, 2016
b3db918
Merge pull request #1265 from strayiker/master
JedWatson Oct 1, 2016
e65b073
Documentation to backspaceToRemoveMessage Property
Oct 4, 2016
e99ab1f
Merge pull request #1257 from jooj123/patch/add-back-on-input-change
JedWatson Oct 5, 2016
4b8ec14
Merge pull request #1281 from jtulk/patch-1
JedWatson Oct 5, 2016
9709ae8
Fixed incorrect prop(onCloseResetsInput) in Readme
Oct 8, 2016
c40fea0
Merge pull request #1288 from raianand/patch-1
JedWatson Oct 8, 2016
dbf6531
Tell git not to merge built files
DanielHeath Oct 6, 2016
ecbed92
Whitespace
DanielHeath Oct 7, 2016
45be8b4
Only remove options if a loading placeholder is available
DanielHeath Oct 6, 2016
37613de
Allow users to specify noResultsText
DanielHeath Oct 9, 2016
7b53119
Merge pull request #1291 from DanielHeath/trailing-whitespace
JedWatson Oct 11, 2016
2c1cc8e
Merge pull request #1290 from DanielHeath/prevent-merging-built-files
JedWatson Oct 11, 2016
75f3e90
Merge pull request #1293 from DanielHeath/add-async-no-results-text
JedWatson Oct 11, 2016
cf0429b
Merge pull request #1292 from DanielHeath/opt-out-of-clearing-options
JedWatson Oct 11, 2016
a7782b3
Clear Async options after making a selection
DanielHeath Oct 4, 2016
6b16a24
Fix issues #1272 and #1287
DanielHeath Oct 11, 2016
47ff3a8
Merge pull request #1289 from DanielHeath/clear-async-after-selection
JedWatson Oct 12, 2016
4487ca7
Merge pull request #1300 from DanielHeath/fix-firefox-alignment
JedWatson Oct 13, 2016
b4a087e
Merge pull request #1255 from rockingskier/master
JedWatson Oct 15, 2016
a13246b
Merge branch 'fix/remove-shared-cache' of https://github.com/TheSharp…
Oct 21, 2016
426e282
Fixed linting issues
Oct 21, 2016
4ba7bb2
Refactored props/cache setting slightly
Oct 21, 2016
a8f4118
Merge branch 'TheSharpieOne-fix/remove-shared-cache'
Oct 21, 2016
dfe4119
Test the focus() method on Select
mcls Oct 27, 2016
ba2bd5e
Re-added the focus() method on Select.Async
mcls Oct 27, 2016
6535445
Add CDNJS version badge in readme
kennynaoh Oct 29, 2016
3ce64c1
Merge pull request #1334 from kennynaoh/cdnjs-badge
JedWatson Oct 30, 2016
1c88892
Mention way to implement allowCreate functionality with Creatable
mayerwin Oct 30, 2016
9dd1d27
Merge pull request #1337 from mayerwin/patch-1
bvaughn Oct 30, 2016
1d9b8a0
Delete key removes an item when there is no input
Nov 3, 2016
a1e0751
Fixed comment indent
Nov 3, 2016
0465ea9
Added README entry for deleteRemoves prop
Nov 3, 2016
77e6cc1
Merge pull request #1347 from forum-is/master
JedWatson Nov 4, 2016
0991ab0
[Fix] Fixes spacing
kamronbatman Nov 8, 2016
bd5e52e
Merge pull request #1358 from kamronbatman/patch-1
dcousens Nov 10, 2016
a91f539
Fix onInputChange lost
Nov 11, 2016
d46f960
Add onNewOptionClick handler
Nov 11, 2016
603bfdd
Merge pull request #1363 from leesiongchan/fix-creatable
JedWatson Nov 11, 2016
ad337ee
Merge pull request #1364 from leesiongchan/extend-creatable
JedWatson Nov 11, 2016
6fcc966
Pass inputProps to inputRenderer
Nov 11, 2016
df99444
Add tests for inputRenderer
Nov 14, 2016
ab82015
Select component passes its :menuRenderer duplicate :onSelect and :se…
Nov 18, 2016
da2f222
Merge pull request #1373 from JedWatson/react-virtualized-select-issu…
bvaughn Nov 18, 2016
cddee25
fix AsyncCreatable options parsing
unity Nov 18, 2016
a97d5fd
Merge pull request #1374 from hull/master
JedWatson Nov 18, 2016
ef3a468
Merge pull request #1367 from quizlet/aw-input-renderer-props
JedWatson Nov 18, 2016
338c0ad
try to focus the next available option after a selection.
nraynaud Nov 30, 2016
88e3395
Update Select.js
khankuan Dec 5, 2016
080670c
Update README.md
khankuan Dec 5, 2016
10cd5b2
updating readme
tnrich Dec 8, 2016
a40ca88
fix(Creatable): Handle null "children" prop gracefully
jscinoz Dec 14, 2016
7ef1013
Fixes #1447 - Uncaught TypeError
thezanke Dec 21, 2016
f11520a
Wrapped or clause (ternary) in parens
thezanke Dec 22, 2016
13444bd
Document the undocumented `ignoreAccents` property
dmatteo Dec 27, 2016
bbc585d
allow rendering a custom clear component
Jan 12, 2017
3aee31f
Fixes for code style consistency
Jan 21, 2017
d316a05
fix arrow flip
Jan 23, 2017
4179217
fixed exception when clearing an Async field that is not set to multi
VanCoding Jan 27, 2017
d1feb1d
Merge pull request #1508 from VanCoding/onchange-fix
JedWatson Jan 31, 2017
d0d2737
Merge pull request #1500 from tlconnor/fixArrowFlip
JedWatson Jan 31, 2017
ca217b9
Porting fix from #1500 to scss stylesheet
JedWatson Jan 31, 2017
350354c
Merge pull request #1496 from ivanzusko/patch-1
JedWatson Jan 31, 2017
2ef6753
Ignoring yarn.lock
JedWatson Jan 31, 2017
5c2f71f
Merge pull request #1478 from conorhastings/clear-renderer
JedWatson Jan 31, 2017
19a6acc
Merge pull request #1451 from dmatteo/patch-1
JedWatson Jan 31, 2017
9a677c2
Indentation fixes
JedWatson Jan 31, 2017
d17c535
Removing an extra space
JedWatson Jan 31, 2017
06766b4
Documenting custom classNames for Select and options, closes #1452
JedWatson Jan 31, 2017
7d4b8f0
Merge pull request #1448 from thezanke/master
JedWatson Jan 31, 2017
c6fa633
Merge pull request #1430 from AvokaTech/master
JedWatson Jan 31, 2017
dbbd63b
Clarifying comment for defaultChildren
JedWatson Jan 31, 2017
00418b3
Merge pull request #1420 from tnrich/patch-1
JedWatson Jan 31, 2017
9bebcd0
Merge pull request #1408 from khankuan/patch-1
JedWatson Jan 31, 2017
b6a0636
Merge pull request #1331 from mcls/master
JedWatson Jan 31, 2017
912cbb8
Merge pull request #1406 from nraynaud/master
JedWatson Jan 31, 2017
bba9077
Fixing a tab where there should be a space
JedWatson Jan 31, 2017
2821f0a
Cleaning up order of focusing
JedWatson Jan 31, 2017
fbeb376
Fixing and documenting focus behaviour for multi-select when adding o…
JedWatson Jan 31, 2017
cab0b72
Positioning fix for the arrow when the menu is open
JedWatson Jan 31, 2017
881873c
Cleaning up boolean value example
JedWatson Jan 31, 2017
ef894a3
Fixing an error thrown in the CustomRender example
JedWatson Jan 31, 2017
732ba55
Updating build
JedWatson Jan 31, 2017
63a59dc
v1.0.0-rc.3
JedWatson Jan 31, 2017
13aee42
Merge tag 'v1.0.0-rc.3' into update-to-upstream-rc.3
Jan 31, 2017
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
translate_tabs_to_spaces = false

[*.json]
indent_style = space
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/* binary
examples/dist/* binary
lib/* binary
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ bower_components

# Other
.DS_Store

yarn.lock
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Multiple values are now submitted in multiple form fields, which results in an a
## New Select.Async Component

`loadingPlaceholder` prop
`autoload` changed to `minimumInput` and now controls the minimum input to load options
`cacheAsyncResults` -> `cache` (new external cache support) - defaults to true

## Fixes & Other Changes
Expand Down
10 changes: 5 additions & 5 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
## v1.0.0-beta14.patch1 / 2016-07-25

* (react-select-plus) On dropdown open, scroll to element above focused option
instead of scrolling all the way to the top of the option group.

## v1.0.0-rc / 2016-09-04

* fixed; reset value to `[]` when `multi=true`, thanks [Michael Williamson](https://github.com/mwilliamson)
Expand All @@ -15,6 +10,11 @@ instead of scrolling all the way to the top of the option group.
* added; `onCloseResetsInput` prop, thanks [Frankie](https://github.com/frankievx)
* added; `Creatable` component, replaces pre-1.0 `allowCreate` prop, thanks [Brian Vaughn](https://github.com/bvaughn)

## v1.0.0-beta14.patch1 / 2016-07-25

* (react-select-plus) On dropdown open, scroll to element above focused option
instead of scrolling all the way to the top of the option group.

## v1.0.0-beta14 / 2016-07-17

* fixed; `react-input-autosize` has been udpated to `1.1.0`, which includes fixes for the new warnings that React 15.2 logs
Expand Down
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
React-Select-Plus
=================

A Select control for [React](http://facebook.github.io/react/index.html) based on [JedWatson/React-Select](https://github.com/JedWatson/react-select/).

Expand Down Expand Up @@ -86,6 +85,12 @@ function logChange(val) {
/>
```

### Custom classNames

You can provide a custom `className` prop to the `<Select>` component, which will be added to the base `.Select` className for the outer container.

The built-in Options renderer also support custom classNames, just add a `className` property to objects in the `options` array.

### Multiselect options

You can enable multi-value selection by setting `multi={true}`. In this mode:
Expand All @@ -95,7 +100,7 @@ You can enable multi-value selection by setting `multi={true}`. In this mode:
* The values of the selected items are joined using the `delimiter` prop to create the input value when `joinValues` is true
* A simple value, if provided, will be split using the `delimiter` prop
* The `onChange` event provides an array of selected options _or_ a comma-separated string of values (eg `"1,2,3"`) if `simpleValue` is true
* By default, only options in the `options` array can be selected. Setting `allowCreate` to true allows new options to be created if they do not already exist. *NOTE:* `allowCreate` is not implemented in `1.0.0-beta`, if you need this option please stay on `0.9.x`.
* By default, only options in the `options` array can be selected. Use the `Creatable` Component (which wraps `Select`) to allow new options to be created if they do not already exist. Hitting comma (','), ENTER or TAB will add a new option. Versions `0.9.x` and below provided a boolean attribute on the `Select` Component (`allowCreate`) to achieve the same functionality. It is no longer available starting with version `1.0.0`.
* By default, selected options can be cleared. To disable the possibility of clearing a particular option, add `clearableValue: false` to that option:
```javascript
var options = [
Expand Down Expand Up @@ -213,8 +218,8 @@ Property | Type | Description
`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` |
`onNewOptionClick` | function | new option click handler, it calls when new option has been selected. `function(option) {}` |
`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 default. 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
Expand Down Expand Up @@ -242,16 +247,18 @@ You can control how options are filtered with the following properties:
* `matchPos`: `"start"` or `"any"`: whether to match the text entered at the start or any position in the option value
* `matchProp`: `"label"`, `"value"` or `"any"`: whether to match the value, label or both values of each option when filtering
* `ignoreCase`: `Boolean`: whether to ignore case or match the text exactly when filtering
* `ignoreAccents`: `Boolean`: whether to ignore accents on characters like ø or å

`matchProp` and `matchPos` both default to `"any"`.
`ignoreCase` defaults to `true`.
`ignoreAccents` defaults to `true`.

#### Advanced filters

You can also completely replace the method used to filter either a single option, or the entire options array (allowing custom sort mechanisms, etc.)

* `filterOption`: `function(Object option, String filter)` returns `Boolean`. Will override `matchPos`, `matchProp` and `ignoreCase` options.
* `filterOptions`: `function(Array options, String filter, Array currentValues)` returns `Array filteredOptions`. Will override `filterOption`, `matchPos`, `matchProp` and `ignoreCase` options.
* `filterOption`: `function(Object option, String filter)` returns `Boolean`. Will override `matchPos`, `matchProp`, `ignoreCase` and `ignoreAccents` options.
* `filterOptions`: `function(Array options, String filter, Array currentValues)` returns `Array filteredOptions`. Will override `filterOption`, `matchPos`, `matchProp`, `ignoreCase` and `ignoreAccents` options.

For multi-select inputs, when providing a custom `filterOptions` method, remember to exclude current values from the returned array of options.

Expand All @@ -278,6 +285,9 @@ The custom `menuRenderer` property accepts the following named parameters:
| focusedOption | `Object` | The currently focused option; should be visible in the menu by default. |
| focusOption | `Function` | Callback to focus a new option; receives the option as a parameter. |
| labelKey | `String` | Option labels are accessible with this string key. |
| optionClassName | `String` | The className that gets used for options |
| optionComponent | `ReactClass` | The react component that gets used for rendering an option |
| optionRenderer | `Function` | The function that gets used to render the content of an option |
| options | `Array<Object>` | Ordered array of options to render. |
| selectValue | `Function` | Callback to select a new option; receives the option as a parameter. |
| valueArray | `Array<Object>` | Array of currently selected options. |
Expand Down Expand Up @@ -328,22 +338,26 @@ 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 })`
arrowRenderer | func | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown, isOpen })`
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
autosize | bool | true | If enabled, the input will expand as the length of its value increases
backspaceRemoves | bool | true | whether pressing backspace removes the last item when there is no input value
backspaceToRemoveMessage | string | 'Press backspace to remove {last label}' | prompt shown in input when at least one option in a multiselect is shown, set to '' to clear
cache | bool | true | enables the options cache for `asyncOptions` (default: `true`)
className | string | undefined | className for the outer element
clearable | bool | true | should it be possible to reset value
clearAllText | string | 'Clear all' | title for the "clear" control when `multi` is true
clearRenderer | func | undefined | Renders a custom clear to be shown in the right-hand side of the select when clearable true: `clearRenderer()`
clearValueText | string | 'Clear value' | title for the "clear" control
resetValue | any | null | value to use when you clear the control
deleteRemoves | bool | true | whether pressing delete key removes the last item when there is no input value
delimiter | string | ',' | delimiter to use to join multiple values
disabled | bool | false | whether the Select is disabled or not
filterOption | func | undefined | method to filter a single option: `function(option, filterString)`
filterOptions | func | undefined | method to filter the options array: `function([options], filterString, [values])`
ignoreAccents | bool | true | whether to strip accents when filtering
ignoreCase | bool | true | whether to perform case-insensitive filtering
inputProps | object | {} | custom attributes for the Input (in the Select-control) e.g: `{'data-foo': 'bar'}`
isLoading | bool | false | whether the Select is loading externally or not (such as options being loaded)
Expand All @@ -356,12 +370,12 @@ function onInputKeyDown(event) {
menuRenderer | func | undefined | Renders a custom menu with options; accepts the following named parameters: `menuRenderer({ focusedOption, focusOption, options, selectValue, valueArray })`
multi | bool | undefined | multi-value input
name | string | undefined | field name, for hidden `<input />` tag
noResultsText | string | 'No results found' | placeholder displayed when there are no matching search results or a falsy value to hide it
noResultsText | string | 'No results found' | placeholder displayed when there are no matching search results or a falsy value to hide it (can also be a react component)
onBlur | func | undefined | onBlur handler: `function(event) {}`
onBlurResetsInput | bool | true | whether to clear input on blur or not
onChange | func | undefined | onChange handler: `function(newValue) {}`
onClose | func | undefined | handler for when the menu closes: `function () {}`
onCloseResetInput | bool | true | whether to clear input when closing the menu through the arrow
onCloseResetsInput | bool | true | whether to clear input when closing the menu through the arrow
onFocus | func | undefined | onFocus handler: `function(event) {}`
onInputChange | func | undefined | onInputChange handler: `function(inputValue) {}`
onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}`
Expand All @@ -374,7 +388,6 @@ function onInputKeyDown(event) {
renderInvalidValues | bool | false | if a `value` does not match any `options`, render it anyway
scrollMenuIntoView | bool | true | whether the viewport will shift to display the entire menu when engaged
searchable | bool | true | whether to enable searching feature or not
searchingText | string | 'Searching...' | message to display whilst options are loading via asyncOptions, or when `isLoading` is true
searchPromptText | string\|node | 'Type to search' | label to prompt for search input
tabSelectsValue | bool | true | whether to select the currently focused value when the `[tab]` key is pressed
value | any | undefined | initial field value
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dist/react-select-plus.min.js",
"dist/react-select-plus.min.css"
],
"version": "1.0.0-rc.1.patch4",
"version": "1.0.0-rc.3",
"homepage": "https://github.com/HubSpot/react-select-plus",
"authors": [
"Trevor Burnham"
Expand Down
5 changes: 4 additions & 1 deletion dist/react-select-plus.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
background: #fff;
border-color: #b3b3b3 #ccc #d9d9d9;
}
.is-open > .Select-control > .Select-arrow {
.is-open > .Select-control .Select-arrow {
top: -2px;
border-color: transparent transparent #999;
border-width: 0 5px 5px;
}
Expand Down Expand Up @@ -193,6 +194,7 @@
display: inline-block;
height: 0;
width: 0;
position: relative;
}
.is-open .Select-arrow,
.Select-arrow-zone:hover > .Select-arrow {
Expand All @@ -208,6 +210,7 @@
margin: -1px;
clip: rect(0, 0, 0, 0);
overflow: hidden;
float: left;
}
@-webkit-keyframes Select-animation-fadeIn {
from {
Expand Down
Loading