<Form /> has runtime errors when `noDefault` is `true`
@ZenMasterJacob20011 已经在做这个了。
开始于 2024年5月15日。
评估
这个 Issue 还没有评估数据。
描述
Formio version @formio/[email protected]
React version: 18.2.0
If noDefault in options is true, an error occurs after choose a file for a file component.
File.js:764 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'some')
at _callee$ (File.js:764:1)
at tryCatch (File.js:99:1)
at Generator.<anonymous> (File.js:99:1)
at Generator.next (File.js:99:1)
at asyncGeneratorStep (File.js:100:1)
at _next (File.js:101:1)
at File.js:101:1
at new Promise (<anonymous>)
at File.js:101:1
at File.js:926:1
_callee$ | @ | File.js:764
-- | -- | --
| tryCatch | @ | File.js:99
| (anonymous) | @ | File.js:99
| (anonymous) | @ | File.js:99
| asyncGeneratorStep | @ | File.js:100
| _next | @ | File.js:101
| (anonymous) | @ | File.js:101
| (anonymous) | @ | File.js:101
| (anonymous) | @ | File.js:926
| upload | @ | File.js:717
| (anonymous) | @ | File.js:465
| Promise.then (async) | |
| (anonymous) | @ | File.js:464
<Form
form={form_json}
onChange={onFormChange}
submission={submission_json}
options={{
noDefaults: true
}}
/>
form_json
{
"components": [
{
"label": "Upload",
"labelPosition": "top",
"description": "",
"tooltip": "",
"customClass": "",
"tabindex": "",
"hidden": false,
"hideLabel": false,
"autofocus": false,
"disabled": false,
"tableView": false,
"modalEdit": false,
"storage": "base64",
"dir": "",
"fileNameTemplate": "",
"image": false,
"uploadOnly": false,
"webcam": false,
"fileTypes": [
{
"label": "",
"value": ""
}
],
"filePattern": "*.heic,*.gif,*.jpg,*.jpeg,*.png,*.bmp,*.pdf,*.zip,*.ppt,*.pptx,*.doc,*.docx,*.xls,*.xlsx",
"fileMinSize": "0KB",
"fileMaxSize": "10MB",
"multiple": false,
"persistent": true,
"protected": false,
"dbIndex": false,
"encrypted": false,
"redrawOn": "",
"clearOnHide": true,
"customDefaultValue": "",
"calculateValue": "",
"calculateServer": false,
"allowCalculateOverride": false,
"validate": {
"required": false,
"customMessage": "",
"custom": "",
"customPrivate": false,
"json": "",
"strictDateValidation": false,
"multiple": false,
"unique": false
},
"errorLabel": "",
"errors": "",
"key": "file",
"tags": [],
"properties": [],
"conditional": {
"show": null,
"when": null,
"eq": "",
"json": ""
},
"customConditional": "",
"logic": [],
"attributes": [],
"overlay": {
"style": "",
"page": "",
"left": "",
"top": "",
"width": "",
"height": ""
},
"type": "file",
"imageSize": "200",
"input": true,
"placeholder": "",
"prefix": "",
"suffix": "",
"defaultValue": null,
"unique": false,
"refreshOn": "",
"dataGridLabel": false,
"widget": null,
"validateOn": "change",
"showCharCount": false,
"showWordCount": false,
"allowMultipleMasks": false,
"addons": [],
"privateDownload": false,
"id": "ecedeus"
}
]
}
- 主要语言
- TypeScript
- 星标
- 371
- 派生
- 309
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
formio/react 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 64/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
onChange `modified` property remains false when file component is updated可能重新可做 @ZenMasterJacob20011 于 293 天前认领,目前没有进行中的 PR。 未关闭
-
FormBuilder onChange callback not triggered when options prop is provided可能重新可做 @Victoriya25 于 335 天前认领,目前没有进行中的 PR。 未关闭
-
FormBuilder with OnChange broke textarea可能重新可做 @lane-formio 于 307 天前认领,目前没有进行中的 PR。 未关闭
相似的 Issue
-
area: batch
难度 2/5 1-3 小时 新手友好度 75/100
inabagumi/shinju-date#7294 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
streaming-video-technology-alliance/common-media-library#700 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
vercel-labs/ui#809 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 67/100
KrisCris/village-in-the-shade-guide#75 ·
维护者通常 1 天内回复
-
bot:ai-assisted component:platform-js status:untriaged
难度 1/5 1 小时以内 新手友好度 74/100
midnightntwrk/platform-js#38 ·