amis icon indicating copy to clipboard operation
amis copied to clipboard

Tab内,form容器组件中配置form时,修改内层的form会自动触发上层form的提交操作

Open seatonxx opened this issue 5 years ago • 2 comments

描述问题:

Tab内,form容器组件中配置form时,修改内层的form,grid内选择框,会自动触发上层form的提交操作 历史类似问题 https://github.com/baidu/amis/pull/589

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的? sdk

  2. 粘贴有问题的完整 amis schema 代码:

{
  "type": "page",
  "name": "page1",
  "body": {
    "type": "form",
    "api": "/api/mock2/form/saveForm?pushCode",
    "controls": [
      {
        "type": "tabs",
        "tabs": [
          {
            "title": "testA",
            "body": {
              "type": "form",
              "controls": [ 
                {
                  "type": "select",
                  "name": "testA",
                  "label": "testA",
                  "inline": true,
                  "options": [
                    {
                      "label": "test1",
                      "value": 1
                    },
                    {
                      "label": "test2",
                      "value": 2
                    } 
                  ],
                  "size": "md",
                  "checkAll": false,
                  "clearable": true
                }
              ]
            }
          },
          {
            "title": "testB",
            controls: [{ 
              body: [{
                title: '',
                type: 'form',
                mode: 'normal',
                wrapWithPanel: false,
                className: 'm-b',
                controls: [{
                  type: 'grid',
                  label: '',
                  columns: [{
                    controls: [
                      {
                        "type": "select",
                        "name": "testB",
                        "label": "testB",
                        "inline": true,
                        "options": [
                          {
                            "label": "test1",
                            "value": 1
                          },
                          {
                            "label": "test2",
                            "value": 2
                          } 
                        ],
                        "size": "md",
                        "checkAll": false,
                        "clearable": true
                      } ],
                    mode: 'horizontal',
                    horizontal: {
                      leftFixed: 'normal',
                      left: 3,
                      right: 9
                    }
                  } ]
                }],
                reload: ''
              } ],
              type: 'page'
            }] 
        
          }
        ]
      }
    ]
  }
}
  1. 操作步骤 testA 空白对照,正常 testB 异常, 修改选项,会提交表单

seatonxx avatar Jan 28 '21 02:01 seatonxx

 "title": "testB",
 controls: [{ 

controls 先改成 body 吧

RickCole21 avatar Jan 29 '21 08:01 RickCole21

未复现,可能是历史bug已修复

CheshireJCat avatar Nov 13 '23 03:11 CheshireJCat