x-ui-design 0.6.73 → 0.6.75

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
@@ -1276,7 +1276,13 @@ const Form$1 = ({
1276
1276
  onFinishFailed
1277
1277
  });
1278
1278
  const formRef = useRef(null);
1279
- const formInstance = useMemo(() => form || internalForm, [form, internalForm]);
1279
+ const formInstance = useMemo(() => {
1280
+ const _form = form || internalForm;
1281
+ if (form && Object.keys(initialValues).length) {
1282
+ _form.setFieldsValue(initialValues);
1283
+ }
1284
+ return _form;
1285
+ }, [form, internalForm]);
1280
1286
  const childrenList = useMemo(() => flattenChildren(children), [children]);
1281
1287
  const handleSubmit = useCallback(async e => {
1282
1288
  e.preventDefault();
@@ -3478,7 +3484,7 @@ const Select = ({
3478
3484
  const asTag = mode === 'tags';
3479
3485
  const asMultiple = mode === 'multiple';
3480
3486
  const hasMode = asTag || asMultiple;
3481
- const initialValue = useMemo(() => value ?? defaultValue ?? '', [value, defaultValue]);
3487
+ const initialValue = useMemo(() => value ?? defaultValue ?? '', [value]);
3482
3488
  const checkModeInitialValue = useMemo(() => (!Array.isArray(initialValue) ? [initialValue] : initialValue).filter(e => e !== undefined && e !== ''), [initialValue]);
3483
3489
  const [isHover, setIsHover] = useState(false);
3484
3490
  const selectRef = useRef(null);