alibaba / x-render

🚴‍♀️ 阿里 - 很易用的中后台「表单 / 表格 / 图表」解决方案
https://xrender.fun
7.05k stars 998 forks source link

^2.0.0-rc.0版本使用form.setValues后输入框/编辑框无法输入 #999

Closed beeant0512 closed 1 year ago

beeant0512 commented 1 year ago

1.依赖仓库的版本(Dependencies versions)

2.问题描述(Bug description): 使用form.setValues后,输入框/编辑框无法输入

3.最小复现 demo(Reproduction demo)

import React from 'react';
import FormRender, {Error, useForm} from 'form-render';
import {Modal} from "antd";

const schema = {
  "type": "object",
  "properties": {
    "b": {
      "title": "简单输入框",
      "type": "string"
    },
    "a": {
      "title": "编辑框",
      "type": "string",
      "format": "textarea",
    }
  },
  "labelWidth": 120,
};

const App = () => {
  const form = useForm();

  const onMount = () => {
    form.setValues({
      a: '111',
      b: '222'
    })
  }

  const onFinish = (formData: any, error: Error[]) => {
    console.log(formData, error)
  }

  return (
    <Modal open={true} width={1330} title="111">
      <FormRender form={form} onMount={onMount} schema={schema} onFinish={onFinish} />
    </Modal>
  );
}

export default App;
ponkans commented 1 year ago

同样的问题 + 1

fengzhongxiaofeng commented 1 year ago

+1

lhbxs commented 1 year ago

1.0 版本不再继续增加新功能,如果需要适配 antd V5 请升级 2.x 版本

beeant0512 commented 1 year ago

就是2.x版本的bug