@manifoldco/react-select-zero
Advanced tools
Comparing version 0.0.1-5 to 0.0.1
{ | ||
"name": "@manifoldco/react-select-zero", | ||
"description": "Zero-dependency, a11y multiselect React component", | ||
"version": "0.0.1-5", | ||
"version": "0.0.1", | ||
"license": "ISC", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -118,3 +118,3 @@ # 🥢 React Select Zero | ||
allowCreate | ||
onChange={setSelection} | ||
onChange={setSelection} // ['Bulbasaur', 'Charmander', 'Squirtle', 'Missingno'] | ||
value={selection} | ||
@@ -127,4 +127,17 @@ > | ||
_Note: user-created options appear in a separate array for convenience._ | ||
User-created values will appear in the same array. To determine new from | ||
existing, you’ll have to scan the `options` you passed for any differences, | ||
e.g.: | ||
```js | ||
onChange={ | ||
(newVal) => { | ||
const created = newVal.filter(val => !options.includes(val)); | ||
const existing = newVal.filter(val => options.includes(val)); | ||
setCreated(created); | ||
setExisting(existing); | ||
} | ||
} | ||
``` | ||
### All Props | ||
@@ -142,3 +155,2 @@ | ||
| `noSearch` | `boolean` | `false` | Set `<Select noSearch />` to hide searching (by default shows with > 5 options) | | ||
| `onChange` | `Function` | | Callback to fire when value changes | | ||
| `placeholder` | `string` | | Specify placeholder text | | ||
@@ -145,0 +157,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59386
217