uiwjs / uiw-admin

UIW-Admin Panel Framework, Powered by React and @uiwjs.
https://uiwjs.github.io/uiw-admin
MIT License
22 stars 20 forks source link

ProForm: onChange事件不触发 #125

Closed gssggssg closed 2 years ago

gssggssg commented 2 years ago

描述错误

uiw admin 进行升级后 ProForm: onChange事件不触发

提供在线重现示例

测试代码


import React, { useState, useRef } from "react";
import ReactDOM from 'react-dom';
import { Form, Input, Row, Col, Slider, Button, Notify } from 'uiw';

function Demo() {
  const form = useRef()
  return (
    <div>
      <Form
        ref={form}
        onChange={({ initial, current }) => {
          console.log('onChange', initial, current);
        }}
        onSubmit={({ initial, current }) => {

        }}
        fields={{
          name: {
            label: '姓名',
            children: <Input placeholder="请输入姓名" />
          },
        }}
      >
        {({ fields, state, canSubmit }) => {
          return (
            <div>
              <Row>
                <Col style={{ maxWidth: 300 }}>{fields.name}</Col>
              </Row>
              <Row>
                <Col>
                  <Button disabled={!canSubmit()} type="primary" htmlType="submit">提交</Button>
                </Col>
              </Row>
            </div>
          )
        }}
      </Form>
    </div>
  )
}
ReactDOM.render(<Demo />, _mount_);

预期行为

onChange事件能触发

截图

项目版本截图 image

桌面(请填写以下信息):

xingyuefeng commented 2 years ago

@gssggssg 更新uiw admin至最新版 已修复