Skip to content

多选组件空的时候设置只读没问题,一旦有值后,设置只读直接报错 #1732

Description

@jevonsflash

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

  • react:18.2.0
  • form-render:v2.5.2
  • antd:5.25.1

2.问题描述(Bug description)

多选组件空的时候设置只读没问题,一旦有值后,设置只读直接起飞,截图如下

Image

3.出现问题的 schema demo(Reproduction schema demo)

{
    "title": "材质",
    "type": "array",
    "props": {
        "mode": "tags",
        "options": [
            {
                "label": "塑料",
                "title": "材质",
                "options": [
                    {
                        "label": "丙烯腈-丁二烯-苯乙烯共聚物",
                        "value": "丙烯腈-丁二烯-苯乙烯共聚物"
                    },
                    {
                        "label": "聚乙烯",
                        "value": "聚乙烯"
                    },
                    {
                        "label": "聚丙烯",
                        "value": "聚丙烯"
                    },
                    {
                        "label": "聚氯乙烯",
                        "value": "聚氯乙烯"
                    },
                    {
                        "label": "聚苯乙烯",
                        "value": "聚苯乙烯"
                    },
                    {
                        "label": "涤纶树脂",
                        "value": "涤纶树脂"
                    }
                ]
            },
            {
                "label": "金属",
                "title": "材质",
                "options": [
                    {
                        "label": "",
                        "value": ""
                    },
                    {
                        "label": "",
                        "value": ""
                    },
                    {
                        "label": "",
                        "value": ""
                    },
                    {
                        "label": "",
                        "value": ""
                    },
                    {
                        "label": "",
                        "value": ""
                    },
                    {
                        "label": "",
                        "value": ""
                    },
                    {
                        "label": "铝合金",
                        "value": "铝合金"
                    }
                ]
            },
            {
                "label": "不锈钢",
                "title": "材质",
                "options": [
                    {
                        "label": "201不锈钢",
                        "value": "201不锈钢"
                    },
                    {
                        "label": "202不锈钢",
                        "value": "202不锈钢"
                    },
                    {
                        "label": "301不锈钢",
                        "value": "301不锈钢"
                    },
                    {
                        "label": "304不锈钢",
                        "value": "304不锈钢"
                    },
                    {
                        "label": "316不锈钢",
                        "value": "316不锈钢"
                    },
                    {
                        "label": "309不锈钢",
                        "value": "309不锈钢"
                    },
                    {
                        "label": "321不锈钢",
                        "value": "321不锈钢"
                    },
                    {
                        "label": "409不锈钢",
                        "value": "409不锈钢"
                    },
                    {
                        "label": "410不锈钢",
                        "value": "410不锈钢"
                    },
                    {
                        "label": "430不锈钢",
                        "value": "430不锈钢"
                    }
                ]
            },
            {
                "label": "玻璃",
                "title": "材质",
                "options": [
                    {
                        "label": "普通玻璃",
                        "value": "普通玻璃"
                    },
                    {
                        "label": "钢化玻璃",
                        "value": "钢化玻璃"
                    }
                ]
            }
        ]
    },
    "widget": "select"
}

4.最小复现 demo(Reproduction demo)

把上面的代码复制到playground,随便设置一些值,然后把input的readOnly属性设置为true,就报错了
https://xrender.fun/playground

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions