@bluemarble/bm-components 0.0.18 → 0.0.19

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/esm/index.js CHANGED
@@ -14863,6 +14863,7 @@ function FormikAutocomplete(_a) {
14863
14863
  const [_b, , { setValue }] = useField({
14864
14864
  name: props.name,
14865
14865
  }), { value: defaultValue } = _b, field = __rest(_b, ["value"]);
14866
+ const defaultOption = useRef();
14866
14867
  const onChange = (_, newValue) => {
14867
14868
  if (getOptionValue) {
14868
14869
  setValue(getOptionValue(newValue));
@@ -14870,7 +14871,11 @@ function FormikAutocomplete(_a) {
14870
14871
  else
14871
14872
  setValue(newValue);
14872
14873
  };
14873
- return (React__default.createElement(Autocomplete$1, Object.assign({}, props, { renderInput: (params) => (React__default.createElement(TextField, Object.assign({}, params, field, { label: props.label }))), defaultValue: props.options.find((option) => Object.values(option)[0] === defaultValue), onChange: onChange })));
14874
+ useEffect(() => {
14875
+ if (!defaultOption.current)
14876
+ defaultOption.current = props.options.find((option) => Object.values(option)[0] === defaultValue);
14877
+ }, []);
14878
+ return (React__default.createElement(Autocomplete$1, Object.assign({}, props, { renderInput: (params) => (React__default.createElement(TextField, Object.assign({}, params, field, { label: props.label }))), defaultValue: defaultOption.current, onChange: onChange })));
14874
14879
  }
14875
14880
 
14876
14881
  const Checkbox = (_a) => {