Giter Club home page Giter Club logo

react-admin-kit's People

Contributors

jay-g2017 avatar jaykou25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-admin-kit's Issues

表单项的校验时机设置 onBlur 不生效

我有一个修改密码的表单, 通过 SchemaForm 组件生成表单, 表单有 '新密码' 和 '确认密码' 两个表单项, '确认密码' 的表单项需要设置检验, 确保其值与 '新密码' 的值相同.

通过 valueType: dependency 和 validator 方法能够实现这个校验的需求.

但是我希望在 onBlur 的时候触发校验, 我在 rules 里设置了 validateTrigger: "onBlur" 不生效. 下面是代码:

[
  {
    title: "新密码",
    dataIndex: "newPassword",
    valueType: "password",
    required: true,
    fieldProps: {
      autoComplete: "new-password",
    },
  },
  {
    valueType: "dependency",
    name: ["newPassword"],
    columns: ({ newPassword }) => {
      return [
        {
          title: "确认密码",
          dataIndex: "confirmPassword",
          valueType: "password",
          fieldProps: {
            autoComplete: "off",
          },
          formItemProps: {
            rules: [
              {
                required: true,
                validateTrigger: "onBlur",
                message: "密码不一致",
                validator(rule, value) {
                  if (value !== newPassword) {
                    return Promise.reject();
                  }

                  return Promise.resolve();
                },
              },
            ],
          },
        },
      ];
    },
  },
];

ProTable 在弹窗里编辑表单时, 点关闭的提醒框 zIndex 有问题

正常 ProTable 在弹窗里编辑表单时, 表单默认带有 confirmOnClose 功能, 即关闭弹窗时, 如果表单项发生了改动会弹出确认框.

但是当 ProTable 处在 Drawer 等原本就已经有遮罩层的容器里时, confirmOnClose 的弹出框会有 zIndex 问题, 即被其它遮罩层遮住.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.