aport-tools 4.4.48 → 4.4.51

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.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! aport-tools v4.4.48 | ISC */
1
+ /*! aport-tools v4.4.51 | ISC */
2
2
  'use strict';
3
3
 
4
4
  var React = require('react');
@@ -826,15 +826,19 @@ var InputList = function InputList(_a) {
826
826
  setSelectedOptions = _l[1];
827
827
  // Update form value when firstValue changes
828
828
  React.useEffect(function () {
829
+ if (!firstValue || firstValue.length === 0) return;
830
+ var matchedSelections = options.filter(function (opt) {
831
+ return firstValue.includes(opt.value);
832
+ });
829
833
  if (multi) {
830
- setSelectedOptions(initialSelections);
831
- setFormValue(name, initialSelections, initialSelections);
834
+ setSelectedOptions(matchedSelections);
835
+ setFormValue(name, matchedSelections, matchedSelections);
832
836
  } else {
833
- var singleValue = initialSelections[0] || null;
837
+ var singleValue = matchedSelections[0] || null;
834
838
  setSelectedOptions(singleValue);
835
839
  setFormValue(name, singleValue, singleValue);
836
840
  }
837
- }, [firstValue, multi, initialSelections]);
841
+ }, [firstValue, multi]);
838
842
  // Handle option selection
839
843
  var handleSelectOption = function handleSelectOption(option) {
840
844
  var updatedSelections;