aport-tools 4.4.32 → 4.4.33

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 CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.32 | ISC */
1
+ /*! aport-tools v4.4.33 | ISC */
2
2
  import React, { useContext, useState, createContext, useRef, 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';
@@ -571,16 +571,14 @@ var Input = function Input(_a) {
571
571
  var isFirstRender = useRef(true); // Track the first render
572
572
  // Initialize the internal value when `firstValue` changes or on first render
573
573
  useEffect(function () {
574
+ var _a;
574
575
  if (isFirstRender.current) {
575
576
  isFirstRender.current = false;
576
- if (firstValue !== undefined) {
577
- setInternalValue(firstValue);
578
- setFormValue(name, firstValue, firstValue); // Pass firstValue here
579
- } else {
580
- setInternalValue(formValues[name] || "");
581
- }
577
+ var initialValue = (_a = firstValue !== null && firstValue !== void 0 ? firstValue : formValues[name]) !== null && _a !== void 0 ? _a : ""; // Priority: firstValue > formValues[name] > ""
578
+ setInternalValue(initialValue);
579
+ setFormValue(name, initialValue, firstValue); // Initialize the form value globally
582
580
  }
583
- }, [firstValue]);
581
+ }, [firstValue, formValues, name, setFormValue]);
584
582
  /**
585
583
  * Handles text changes in the input field, applying formatting based on the inputType.
586
584
  *