aport-tools 4.4.14 → 4.4.15
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.esm.js +7 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! aport-tools v4.4.
|
1
|
+
/*! aport-tools v4.4.15 | ISC */
|
2
2
|
import React, { useContext, useState, createContext, useEffect, useCallback, useMemo } from 'react';
|
3
3
|
import { StyleSheet, Text as Text$1, Animated, View, TouchableOpacity, Image, TextInput, Modal, Pressable, FlatList, Keyboard, Platform, Alert, ActivityIndicator } from 'react-native';
|
4
4
|
import { ThemeContext } from 'aport-themes';
|
@@ -747,12 +747,14 @@ var InputList = function InputList(_a) {
|
|
747
747
|
return firstValue.includes(opt.value);
|
748
748
|
});
|
749
749
|
var _l = useState(multi ? initialSelections : initialSelections[0] || null),
|
750
|
-
selectedOptions = _l[0]
|
751
|
-
_l[1];
|
750
|
+
selectedOptions = _l[0],
|
751
|
+
setSelectedOptions = _l[1];
|
752
752
|
// Update form value on mount if firstValue is provided
|
753
753
|
useEffect(function () {
|
754
|
-
|
755
|
-
|
754
|
+
if (Array.isArray(firstValue) && firstValue.length > 0) {
|
755
|
+
setSelectedOptions(firstValue);
|
756
|
+
}
|
757
|
+
}, [firstValue, setSelectedOptions]); // Dependencies are properly set.
|
756
758
|
/**
|
757
759
|
* Handles selection of an option. Adds or removes the option from selectedOptions based on
|
758
760
|
* multi-selection and maxSelection criteria.
|