@rolster/react-components 18.10.4 → 18.10.5

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/es/index.js CHANGED
@@ -1282,13 +1282,13 @@ function useAutocompleteField({ suggestions, disabled, formControl, onSelect, on
1282
1282
  useEffect(() => filterSuggestions(pattern, true), [suggestions]);
1283
1283
  useEffect(() => filterSuggestions(pattern), [pattern]);
1284
1284
  useEffect(() => {
1285
- changeInternal ? setChangeInternal(false) : resetComponent();
1285
+ changeInternal ? setChangeInternal(false) : resetState();
1286
1286
  }, [formControl?.state]);
1287
- useEffect(() => setValue(requestCurrentElement()?.description || ''), [collection]);
1287
+ useEffect(() => resetState(), [collection]);
1288
1288
  function requestCurrentElement() {
1289
1289
  return formControl?.state && collection.find(formControl.state);
1290
1290
  }
1291
- function resetComponent() {
1291
+ function resetState() {
1292
1292
  const element = requestCurrentElement();
1293
1293
  setValue(element?.description || '');
1294
1294
  if (!element) {
@@ -1742,9 +1742,9 @@ function RlsDateField({ children, date, disabled, formControl, maxDate, minDate,
1742
1742
  }
1743
1743
  function onChange(value, ignoreControl = false) {
1744
1744
  if (!ignoreControl) {
1745
- formControl?.setState(undefined);
1745
+ formControl?.setState(value);
1746
1746
  }
1747
- setValue(undefined);
1747
+ setValue(value);
1748
1748
  if (onValue) {
1749
1749
  onValue(value);
1750
1750
  }
@@ -1889,13 +1889,13 @@ function useSelectField({ suggestions, formControl, onSelect, onValue }) {
1889
1889
  const { collection, inputRef, visible, setFocused, setValue, setVisible, navigationElement, navigationInput } = listControl;
1890
1890
  const [changeInternal, setChangeInternal] = useState(false);
1891
1891
  useEffect(() => {
1892
- changeInternal ? setChangeInternal(false) : resetComponent();
1892
+ changeInternal ? setChangeInternal(false) : resetState();
1893
1893
  }, [formControl?.state]);
1894
- useEffect(() => setValue(requestCurrentElement()?.description || ''), [collection]);
1894
+ useEffect(() => resetState(), [collection]);
1895
1895
  function requestCurrentElement() {
1896
1896
  return formControl?.state && collection.find(formControl.state);
1897
1897
  }
1898
- function resetComponent() {
1898
+ function resetState() {
1899
1899
  const element = requestCurrentElement();
1900
1900
  setValue(element?.description || '');
1901
1901
  if (!element) {