Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
40db517
[FIX] #1651 moved option prop sync to componentWillReceiveProps (#1765)
cbergmiller Jun 3, 2017
07dc061
[ADD] Clarified the onInputChange prop signature in the docs (#1773)
cbergmiller Jun 6, 2017
ec53f0b
Update Select.js
xakep139 Jun 7, 2017
40a9eb2
Fix backspace handling for non-multi select controls. Fixes #638 (#773)
MrLeebo Jun 14, 2017
61126da
Merge pull request #1779 from xakep139/patch-1
JedWatson Jun 16, 2017
ce81389
Adding merged changes to changelog
JedWatson Jun 16, 2017
d8a34ec
Update README.md to include 'valueComponent' prop (#1803)
lstuartfry Jun 21, 2017
b068247
Hide create option after closing menu (#1306)
andreme Jun 23, 2017
2616930
Fix Usage Docs Example (#1799)
rohmanhm Jun 26, 2017
f67f514
convert AsyncCreatable to ES6 class
jochenberger Jun 26, 2017
bd453dd
convert CreatableSelect to ES6 class
jochenberger Jun 26, 2017
396ed4b
convert Option to ES6 class
jochenberger Jun 26, 2017
1a8d712
convert Select to ES6 class
jochenberger Jun 26, 2017
9f118e2
convert Value to ES6 class
jochenberger Jun 26, 2017
55b4df4
fix scroll focus when using up arrow key
boatkorachal Jun 27, 2017
d175738
Reset required value to default on newProps
karaggeorge Jun 28, 2017
53b30eb
Add required prop to README.md
karaggeorge Jun 28, 2017
53ec747
Update Template to point users to SO and update plnkr
agirton Jun 29, 2017
23d6abe
Merge pull request #1844 from agirton/update/ISSUE_TEMPLATE
agirton Jun 29, 2017
3506311
Merge pull request #1823 from jochenberger/use-es6-4
agirton Jul 3, 2017
dc739a2
Merge pull request #1824 from jochenberger/use-es6-5
agirton Jul 3, 2017
3de32a4
Merge pull request #1822 from jochenberger/use-es6-3
agirton Jul 3, 2017
d85a2c3
Merge pull request #1821 from jochenberger/use-es6-2
agirton Jul 3, 2017
48348bc
Merge pull request #1820 from jochenberger/use-es6-1
agirton Jul 3, 2017
396993c
remove create-react-class dependency from main sources
jochenberger May 18, 2017
da437ce
fix tests
jochenberger Jul 4, 2017
9acb454
Merge pull request #1853 from jochenberger/fix-select
agirton Jul 4, 2017
65daf20
Update README.md
lordofthecactus Jul 5, 2017
c0bae3d
Only set state if required prop changed
karaggeorge Jul 5, 2017
87a82b3
Bugfix/remove circular refs (#1855)
agirton Jul 5, 2017
e1bb7b9
Avoid mutating user input when ignoring case/accents (fixes #1352)
not-an-aardvark Jul 5, 2017
8631d18
Merge pull request #1858 from not-an-aardvark/no-mutate-input-value
agirton Jul 6, 2017
864794c
Merge pull request #1849 from jochenberger/use-es6-classes
agirton Jul 6, 2017
6c0ee59
Merge pull request #1857 from ieldanr/patch-1
agirton Jul 6, 2017
2fd6e91
Fix clearable padding style
mmiyauchi Jul 11, 2017
0942c92
Update Selectize.js link in the README
Kerumen Jul 24, 2017
14068ca
fix bug, if wrote "hasOwnProperty"
SuhushinAS Jul 27, 2017
2da6ff6
tabindex parent bug fix for edge
George-A-Payne Jul 4, 2017
f7cd6c2
`openAfterFocus` change was accidentally reverted in the rc4 release.
agirton Jul 31, 2017
f343f92
Merge pull request #1902 from agirton/fix-open-after-focus
agirton Jul 31, 2017
4802928
binds handleTouchEnd in Option component
blacktemplar Aug 1, 2017
28281a2
Merge pull request #1905 from blacktemplar/option_undefined_this_fix
agirton Aug 3, 2017
3a58d72
Fix: onMenuScrollToBottom doesn't work in Chrome 58 and newer
deevus Aug 11, 2017
eb54521
simplify constructor method binding
Aug 18, 2017
24f1ce6
Add missing method binds in Option
agirton Aug 26, 2017
af0aa5a
Merge pull request #1944 from agirton/bugfix/missing-binds
agirton Aug 26, 2017
32cf6dd
add onSelectResetsInput prop
davidroeca Aug 30, 2017
8ead69e
update the setState logic
davidroeca Aug 30, 2017
eabec90
update spaces->tabs
davidroeca Aug 31, 2017
a20543f
more style fixes
davidroeca Aug 31, 2017
7a45539
Export the Value component
Grahack Sep 4, 2017
2746261
new build process with rollup and webpack
Aug 29, 2017
e0ccbb9
Merge pull request #1953 from JedWatson/feature/new-build-process
JedWatson Sep 5, 2017
fa81280
coveraged configuration fixed, contrb document edited
gwyneplaine Sep 5, 2017
acb2152
update coveralls script and remove babel-register from core depenencies
gwyneplaine Sep 5, 2017
ec5bd6d
Merge pull request #1963 from JedWatson/update/contribdocs-and-coverage
gwyneplaine Sep 5, 2017
482562a
simplify stringifyValue
dysfunc Aug 18, 2017
ac2325f
Fix wrapping on Firefox in SCSS files
mwilliamson Sep 7, 2017
e65c45b
Merge pull request #1889 from Kerumen/patch-1
gwyneplaine Sep 8, 2017
07c7108
update changelog
gwyneplaine Sep 8, 2017
53e68db
Merge pull request #1969 from JedWatson/update/changelog
JedWatson Sep 8, 2017
a288be7
Merge pull request #1854 from George-A-Payne/edge-tabindex-bugfix
JedWatson Sep 8, 2017
ed1c7cf
Merge pull request #1952 from davidroeca/onSelectResetsInput
JedWatson Sep 9, 2017
2d388dc
Merge pull request #1839 from karaggeorge/required-bug
JedWatson Sep 9, 2017
4963924
Updating changelog and readme
JedWatson Sep 9, 2017
c1722bb
Merge branch 'master' of https://github.com/JedWatson/react-select
JedWatson Sep 9, 2017
d260232
Upgrading dependencies, inc. React 16 support
JedWatson Sep 9, 2017
2c12608
Update eslint config and fix lint errors
JedWatson Sep 9, 2017
d02e71c
Remove deprectated eact-addons-test-utils
JedWatson Sep 9, 2017
5db27b5
Updating travis config
JedWatson Sep 9, 2017
8ee4e68
Minor rollup config tweak
JedWatson Sep 9, 2017
1aa5134
Updating build
JedWatson Sep 9, 2017
1c08fbd
Updating copyright
JedWatson Sep 9, 2017
c4830c6
v1.0.0-rc.6
JedWatson Sep 9, 2017
f91b122
fix esbuild babel presets
gwyneplaine Sep 11, 2017
220a32f
Merge pull request #1976 from JedWatson/issue-1971
gwyneplaine Sep 11, 2017
9cfeb4d
Updating build
JedWatson Sep 11, 2017
8650f16
v1.0.0-rc.7
JedWatson Sep 11, 2017
25ec572
Add es6 build and clean up config, fixes #1981
JedWatson Sep 11, 2017
069793c
Set `_callback` to null when AsyncSelect unmounts.
DeadHeadRussell Sep 11, 2017
53f9bbc
Merge pull request #1923 from deevus/chrome/onMenuScrollToBottom
JedWatson Sep 12, 2017
9e63b8a
add external reference to es build configuration in rollup.config.js
gwyneplaine Sep 12, 2017
116e920
Merge branch 'master' of https://github.com/JedWatson/react-select
gwyneplaine Sep 12, 2017
8c89607
Updating react-input-autosize dependency
JedWatson Sep 12, 2017
ad1e775
Fix test broken by react-input-autosize update
JedWatson Sep 12, 2017
4344657
Updating build
JedWatson Sep 12, 2017
a2047f0
v1.0.0-rc.8
JedWatson Sep 12, 2017
93d84b8
Merge pull request #1967 from mwilliamson/patch-1
JedWatson Sep 12, 2017
477e0ab
Merge pull request #1984 from DeadHeadRussell/patch-1
JedWatson Sep 12, 2017
6be2b66
Merge pull request #1962 from Grahack/patch-1
JedWatson Sep 12, 2017
d4d836e
Updating index.umd to export Value, ref #1962
JedWatson Sep 12, 2017
bf343fe
Merge pull request #1933 from dysfunc/bindings
JedWatson Sep 12, 2017
1dea265
Merge pull request #1932 from dysfunc/patch-1
JedWatson Sep 12, 2017
6a7778f
Check before calling onChange, fixes #1988
JedWatson Sep 12, 2017
8795499
Merge branch 'master' of https://github.com/JedWatson/react-select
JedWatson Sep 12, 2017
772e7a0
Updating standalone (umd) example
JedWatson Sep 12, 2017
1f6e299
Fix peerDependencies for 'prop-types' package
MichaelDeBoey Sep 12, 2017
9ed39d4
Fix inputValue lag in Async, closes #1960
JedWatson Sep 12, 2017
7720dbb
Fix linter issues and tests for Async
JedWatson Sep 12, 2017
9afde47
Updating changelog
JedWatson Sep 12, 2017
80a9a34
Merge pull request #1990 from MichaelDeBoey/prop-types
JedWatson Sep 12, 2017
c7fe6f4
Adding closeOnSelect prop, closes #1194
JedWatson Sep 12, 2017
e1e11fa
Fixing inconsistent whitespace
JedWatson Sep 12, 2017
8adf585
Add closeOnSelect to tests that expect it
JedWatson Sep 12, 2017
a13b144
Required was not being updated without an onChange handler
JedWatson Sep 12, 2017
f0722ec
Async shouldn't always clear options on select
JedWatson Sep 12, 2017
195964a
Remove use of Object.assign, fixes #1987
JedWatson Sep 12, 2017
bd8fdd7
Merge pull request #1866 from mmiyauchi/fix-clearable-style
JedWatson Sep 12, 2017
33f118f
v1.0.0-rc.9
JedWatson Sep 12, 2017
7cf2a56
Updating build
JedWatson Sep 12, 2017
a693fc4
Resolves PropType deprecation warning
MrLeebo Sep 12, 2017
796a7ee
Merge pull request #1991 from MrLeebo/patch-1
gwyneplaine Sep 13, 2017
bf90c75
Merge pull request #1831 from boatkorachal/fix-scroll-focus
JedWatson Sep 13, 2017
c994f05
Update package.json
jochenberger Sep 13, 2017
5ff4dfb
Updating build
JedWatson Sep 13, 2017
b13e01b
Updating standalone usage docs, closes #1996
JedWatson Sep 13, 2017
c1001ea
Merge pull request #1995 from jochenberger/patch-3
JedWatson Sep 13, 2017
36bdf9c
Adding openOnClick prop, closes #1994
JedWatson Sep 13, 2017
61e65d5
Fixing tests for openOnClick, closes #1980
JedWatson Sep 13, 2017
1c2f096
Merge branch 'master' of https://github.com/JedWatson/react-select
JedWatson Sep 13, 2017
eef7e45
Merge pull request #1894 from SuhushinAS/patch-1
JedWatson Sep 13, 2017
2c839e3
Updating build
JedWatson Sep 13, 2017
546403a
v1.0.0-rc.10
JedWatson Sep 13, 2017
5311373
Merge tag 'v1.0.0-rc.10' into update-to-upstream-rc.10
Oct 20, 2017
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
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ignore": ["node-modules/**", "src/index.umd.js"],
"presets": [ "es2015", "stage-0", "react"],
"env": {
"test": {
"plugins": ["istanbul"],
},
}
}
35 changes: 0 additions & 35 deletions .eslintrc

This file was deleted.

41 changes: 41 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
},
env: {
browser: true,
es6: true,
node: true,
},
plugins: ['react'],
rules: {
'curly': [2, 'multi-line'],
'jsx-quotes': 1,
'no-shadow': 0,
'no-trailing-spaces': 0,
'no-underscore-dangle': 0,
'no-unused-expressions': 0,
'object-curly-spacing': [1, 'always'],
'quotes': [2, 'single', 'avoid-escape'],
'react/jsx-boolean-value': 1,
'react/jsx-no-undef': 1,
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'react/jsx-wrap-multilines': 1,
'react/no-did-mount-set-state': 1,
'react/no-did-update-set-state': 1,
'react/no-unknown-property': 1,
'react/prop-types': 1,
'react/react-in-jsx-scope': 1,
'react/self-closing-comp': 1,
'react/sort-comp': 1,
'react/sort-prop-types': 1,
'semi': 2,
'strict': 0,
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pids
# Coverage tools
lib-cov
coverage
.nyc_output

# Dependency directory
node_modules
Expand Down
12 changes: 12 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"reporter": [
"lcov",
"text-summary"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false,
"report-dir": "./coverage"
}
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
sudo: false
language: node_js
node_js:
- "v4"
- "v4"
script:
- npm run coveralls
- npm run lint
- npm run test
- npm run coveralls
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Thanks for your interest in React-Select. All forms of contribution are
welcome, from issue reports to PRs and documentation / write-ups.

* We use node.js v4 for development and testing. Due to incompatibilities with
JSDOM and older versions of node.js, you'll need to use node 4 to run the
tests. If you can't install node v4 as your "default" node installation, you
* We use node.js v4+ for development and testing. Due to incompatibilities with
JSDOM and older versions of node.js, you'll need to use node 4 and above to run the
tests. If you can't install node v4 or above as your "default" node installation, you
could try using [nvm](https://github.com/creationix/nvm) to install multiple
versions concurrently.
* If you're upgrading your node.js 0.x environment, it's sometimes necessary
Expand Down
54 changes: 54 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# React-Select-Plus

## v1.0.0-rc.10 / 2017-09-13

* changed; `openAfterFocus` prop has been renamed to `openOnClick`, and now default to `true`
* fixed; React.PropTypes deprecation warning, thanks [Jeremy Liberman](https://github.com/MrLeebo)
* improved; scrolling behaviour when navigating the menu with the keyboard, thanks [boatkorachal](https://github.com/boatkorachal)
* fixed; error with the `Async` cache when you type `"hasOwnProperty"`, thanks [SuhushinAS](https://github.com/SuhushinAS)

## v1.0.0-rc.9 / 2017-09-13

* fixed; clearable padding style, thanks [Minori Miyauchi](https://github.com/mmiyauchi)
* fixed; removed use of `Object.assign`, fixes IE compatibility
* added; new `closeOnSelect` prop (defaults to `true`) that controls whether the menu is closed when an option is selected, thanks to [Michael Elgar](https://github.com/melgar) for the original idea
* changed; by default, the menu for multi-selects now closes when an option is selected
* changed; `Async` component no longer always clears options when one is selected (although the menu is now closed by default). Use `closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open.
* fixed; `Async` component always called `onChange` even when it wasn't provided
* fixed; input lag for the `Async` component when results are returned from cache
* fixed; required was not being updated without an onChange handler
* fixed; peer dependencies for `prop-types`, thanks [Michaël De Boey](https://github.com/MichaelDeBoey)
* fixed; internal optimisations, thanks [Kieran Boyle](https://github.com/dysfunc)
* added; `Value` component is now exported, thanks [Prof Gra](https://github.com/Grahack)
* fixed; callback fired after `Async` component unmounts, thanks [Andrew Russell](https://github.com/DeadHeadRussell)
* fixed; wrapping on Firefox in SCSS files, thanks [Michael Williamson](https://github.com/mwilliamson)

## v1.0.0-rc.8 / 2017-09-12

* fixed; `onMenuScrollToBottom` does not work in chrome 58.0, thanks [Simon Hartcher](https://github.com/deevus)
* fixed; missing es6 module build for `js:next` entrypoint
* updated; `react-input-autosize@2.0.0` including several fixes for react-select (see [changes](https://github.com/JedWatson/react-input-autosize/blob/master/HISTORY.md))

## v1.0.0-rc.7 / 2017-09-11

* fixed; issue with `lib` build preventing use in ES2015 environments

## v1.0.0-rc.6 / 2017-09-10

* fixed; changing `required` prop from `true` to `false` now works as expected, thanks [George Karagkiaouris](https://github.com/karaggeorge)
* added; new prop `onSelectResetsInput` controls whether the input value is cleared when options are selected, thanks [David Roeca](https://github.com/davidroeca) and [Alexander Nosov](https://github.com/nosovsh)
* fixed; tabindex parent bug fix for Edge, thanks [George Payne](https://github.com/George-A-Payne)
* fixed; update selectize link in README.md, thanks [kerumen](https://github.com/kerumen)
* added; standard issue template, thanks [agirton](https://github.com/agirton)
* added; new build process using rollup and webpack. Removed grunt. thanks [gwyneplaine](https://github.com/gwyneplaine)
* fixed; updated contributor docs with the correct node version reference [gwyneplaine](https://github.com/gwyneplaine)
* fixed; missing method binds in Option, thanks [agirton](https://github.com/agirton)
* fixed; converted components to use es6 classes, thanks [jochenberger](https://github.com/jochenberger)
* fixed; console.log example in usage docs, thanks [rohmanhm](https://github.com/rohmanhm)
* fixed; hide create option after closing menu, thanks [andreme](https://github.com/andreme)
* fixed; remove circular reference, thanks [agirton](https://github.com/agirton)
* fixed; readme typo, thanks [ieldanr](https:/github.com/ieldanr)
* fixed; add missing function binds in Option component, thanks [agirton](https://github.com/agirton) and [blacktemplar](https://github.com/blacktemplar)
* fixed; re-added fix to [#1580](https://github.com/JedWatson/react-select/issues/1580), thanks [agirton](https://github.com/agirton)
* fixed; avoid mutating user inputs when ignoring case/accents, thanks [not-an-aardvark](https://github.com/not-an-aardvark)
* fixed; issues synchronising options props in `Async`, thanks [cbergmiller](https://github.com/cbergmiller)
* fixed; backspace handling for non-multi select controls, thanks [Jeremy Liberman](https://github.com/MrLeebo)

## v1.0.0-rc.5 / 2017-05-25

* fixed; Allow `falsey` values to be clearable, thanks [Simon Gaestel](https://github.com/sgaestel)
Expand Down
19 changes: 17 additions & 2 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
### Thanks for using react-select!

If you are reporting an error please include a test case that demonstrates the issue you're reporting!
Before creating an issue...

# Are you asking a question?
Please don't file GitHub issues to ask questions. Use Stack Overflow with a [#react-select](http://stackoverflow.com/questions/tagged/react-select) tag


# Are you reporting a bug or runtime error?
Please include a test case that demonstrates the issue you're reporting!
This is very helpful to maintainers in order to help us see the issue you're seeing.

Here is a Plunker you can fork that has react-select loaded and supports JSX syntax:
https://plnkr.co/edit/HTmtER9AMNcPoWhXV707?p=preview
https://plnkr.co/edit/dHygFMWWqVwaRAfpEmbn?p=preview

You may also find the [online Babel tool](https://babeljs.io/repl/) quite helpful if you wish to use ES6/ES7 syntax not yet supported by the browser you are using.


# Are you making a feature request?
Provide as much information as possible about your requested feature. Here are a few questions you may consider answering:

* What's your use case? (Tell us about your application and what problem you're trying to solve.)
* What interface do you have in mind? (What new properties or methods do you think might be helpful?)
* Can you point to similar functionality with any existing libraries or components? (Working demos can be helpful.)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 HubSpot
Copyright (c) 2017 HubSpot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ import Select from 'react-select-plus';
import 'react-select-plus/dist/react-select-plus.css';
```

You can also use the standalone build by including `react-select-plus.js` and `react-select-plus.css` in your page. (If you do this though you'll also need to include the dependencies.) For example:
You can also use the standalone UMD build by including `dist/react-select-plus.js` and `dist/react-select-plus.css` in your page. If you do this you'll also need to include the dependencies. For example:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<script src="https://unpkg.com/classnames/index.js"></script>
<script src="https://unpkg.com/react-input-autosize/dist/react-input-autosize.js"></script>
<script src="https://unpkg.com/react-select-plus/dist/react-select-plus.js"></script>
<script src="https://unpkg.com/react@15.6.1/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15.6.1/dist/react-dom.js"></script>
<script src="https://unpkg.com/prop-types@15.5.10/prop-types.js"></script>
<script src="https://unpkg.com/classnames@2.2.5/index.js"></script>
<script src="https://unpkg.com/react-input-autosize@2.0.0/dist/react-input-autosize.js"></script>
<script src="https://unpkg.com/react-select/dist/react-select-plus.js"></script>

<link rel="stylesheet" href="https://unpkg.com/react-select-plus/dist/react-select-plus.css">
```
Expand All @@ -74,7 +76,7 @@ var options = [
];

function logChange(val) {
console.log("Selected: " + val);
console.log("Selected: " + JSON.stringify(val));
}

<Select
Expand Down Expand Up @@ -268,7 +270,7 @@ The default `filterOptions` method scans the options array for matches each time
This works well but can get slow as the options array grows to several hundred objects.
For larger options lists a custom filter function like [`react-select-fast-filter-options`](https://github.com/bvaughn/react-select-fast-filter-options) will produce better results.

### Effeciently rendering large lists with windowing
### Efficiently rendering large lists with windowing

The `menuRenderer` property can be used to override the default drop-down list of options.
This should be done when the list is large (hundreds or thousands of items) for faster rendering.
Expand All @@ -294,13 +296,14 @@ The custom `menuRenderer` property accepts the following named parameters:

### Updating input values with onInputChange

You can manipulate the input using the onInputChange and returning a new value.
You can manipulate the input by providing a `onInputChange` callback that returns a new value.
**Please note:** When you want to use `onInputChange` only to listen to the input updates, you still have to return the unchanged value!

```js
function cleanInput(inputValue) {
// Strip all non-number characters from the input
return inputValue.replace(/[^0-9]/g, "");
}
}

<Select
name="form-field-name"
Expand Down Expand Up @@ -351,7 +354,7 @@ function onInputKeyDown(event) {
| 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 |
| closeOnSelect | bool | true | whether to close the menu when a value is selected
| 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 |
Expand All @@ -377,20 +380,25 @@ function onInputKeyDown(event) {
| onClose | func | undefined | handler for when the menu closes: `function () {}` |
| 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) {}` |
| onInputChange | func | undefined | onInputChange handler/interceptor: `function(inputValue: string): string` |
| onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}` |
| onOpen | func | undefined | handler for when the menu opens: `function () {}` |
| onSelectResetsInput | bool | true | whether the input value should be reset when options are selected, for `multi`
| onValueClick | func | undefined | onClick handler for value labels: `function (value, event) {}` |
| openOnFocus | bool | false | open the options menu when the input gets focus (requires searchable = true) |
| openOnClick | bool | true | open the options menu when the control is clicked (requires searchable = true) |
| openOnFocus | bool | false | open the options menu when the control gets focus (requires searchable = true) |
| optionRenderer | func | undefined | function which returns a custom way to render the options in the menu |
| options | array | undefined | array of options |
| placeholder | string\|node | 'Select ...' | field placeholder, displayed when there's no value |
| required | bool | false | applies HTML5 required attribute when needed |
| resetValue | any | null | value to set when the control is cleared |
| 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 |
| searchPromptText | string\|node | 'Type to search' | label to prompt for search input |
| loadingPlaceholder | string\|node | 'Loading...' | label to prompt for loading search result |
| tabSelectsValue | bool | true | whether to select the currently focused value when the `[tab]` key is pressed |
| value | any | undefined | initial field value |
| valueComponent | func | <Value /> | function which returns a custom way to render/manage the value selected `<CustomValue />` |
| valueKey | string | 'value' | the option property to use for the value |
| valueRenderer | func | undefined | function which returns a custom way to render the value selected `function (option) {}` |

Expand All @@ -407,9 +415,9 @@ Right now there's simply a `focus()` method that gives the control focus. All ot

See our [CONTRIBUTING.md](https://github.com/JedWatson/react-select/blob/master/CONTRIBUTING.md) for information on how to contribute.

Thanks to the projects this was inspired by: [Selectize](http://brianreavis.github.io/selectize.js/) (in terms of behaviour and user experience), [React-Autocomplete](https://github.com/rackt/react-autocomplete) (as a quality React Combobox implementation), as well as other select controls including [Chosen](http://harvesthq.github.io/chosen/) and [Select2](http://ivaynberg.github.io/select2/).
Thanks to the projects this was inspired by: [Selectize](http://selectize.github.io/selectize.js/) (in terms of behaviour and user experience), [React-Autocomplete](https://github.com/rackt/react-autocomplete) (as a quality React Combobox implementation), as well as other select controls including [Chosen](http://harvesthq.github.io/chosen/) and [Select2](http://ivaynberg.github.io/select2/).


# License

MIT Licensed. Copyright (c) HubSpot 2016.
MIT Licensed. Copyright (c) HubSpot 2017.
10 changes: 3 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
"dist/react-select-plus.min.js",
"dist/react-select-plus.min.css"
],
"version": "1.0.0-rc.4",
"version": "1.0.0-rc.10",
"homepage": "https://github.com/HubSpot/react-select-plus",
"authors": [
"Trevor Burnham"
],
"description": "A Select control built with and for ReactJS",
"moduleType": [
"amd",
"globals",
"node"
],
"moduleType": ["amd", "globals", "node"],
"dependencies": {
"classnames": "^2.2.0",
"react-input-autosize": "^1.1.0"
"react-input-autosize": "^2.0.1"
},
"keywords": [
"react",
Expand Down
3 changes: 3 additions & 0 deletions dist/react-select-plus.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.has-value.is-clearable.Select--single > .Select-control .Select-value {
padding-right: 42px;
}
.has-value.Select--single > .Select-control .Select-value .Select-value-label,
.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label {
color: #333;
Expand Down
Loading