aport-tools 4.4.16 → 4.4.17

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.
@@ -14,7 +14,7 @@ interface InputListProps {
14
14
  /**
15
15
  * Optional first value if you want to set values with fetch or dont have empty inputs.
16
16
  */
17
- firstValue?: any[];
17
+ firstValue?: any[] | any;
18
18
  placeholder?: string;
19
19
  /**
20
20
  * Custom styles for the component.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.16 | ISC */
1
+ /*! aport-tools v4.4.17 | ISC */
2
2
  import React, { useContext, useState, createContext, useEffect, useMemo, useCallback } 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';
@@ -737,7 +737,7 @@ var InputList = function InputList(_a) {
737
737
  var _k = useState(false),
738
738
  isDropdownVisible = _k[0],
739
739
  setIsDropdownVisible = _k[1];
740
- var selectedOptions = formValues[name] || (multi ? [] : null);
740
+ var selectedOptions = firstValue || formValues[name] || (multi ? [] : null);
741
741
  var sortedOptions = useMemo(function () {
742
742
  return sortBy ? __spreadArray([], options, true).sort(function (a, b) {
743
743
  return a[sortBy] > b[sortBy] ? 1 : -1;
@@ -755,7 +755,7 @@ var InputList = function InputList(_a) {
755
755
  setInternalValue(firstValue);
756
756
  setFormValue(name, firstValue);
757
757
  } else {
758
- setInternalValue(selectedValue || "");
758
+ setInternalValue(selectedValue || (multi ? [] : null));
759
759
  }
760
760
  }, [firstValue, formValues[name]]);
761
761
  /**