@kne/super-select 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +0 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +3 -3
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2396,9 +2396,9 @@ const SelectInput = p => {
|
|
|
2396
2396
|
};
|
|
2397
2397
|
const onSelect = (item, currentSetValue) => {
|
|
2398
2398
|
(currentSetValue || setValue)(value => {
|
|
2399
|
-
const newValue = value.slice(0);
|
|
2400
|
-
const index =
|
|
2401
|
-
if (index === -1 && !checkMaxLength(
|
|
2399
|
+
const newValue = (value || []).slice(0);
|
|
2400
|
+
const index = newValue.findIndex(currentItem => currentItem.value === item.value);
|
|
2401
|
+
if (index === -1 && !checkMaxLength(newValue, maxLength)) {
|
|
2402
2402
|
return value;
|
|
2403
2403
|
}
|
|
2404
2404
|
if (index === -1) {
|