-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Duplicate of #Describe the bug
File component after upload should emit fileUploadingEnd event with promise or fullfilled object:
https://help.form.io/developers/form-development/form-renderer#form-events
but it returns empty object arguments[19][0] in the time of event. You must set the timeout to access this object.
arguments[20][0] is not used.
Version/Branch
5.3.0-rc.2
To Reproduce
Steps to reproduce the behavior:
- Create form...
- Add file component
- set the logic with event fileUploadingEnd as trigger and custom action:
console.log(arguments[20][0]);
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="bootstrap.min.css"/>
<script src="formio.full.5.3.0-rc.2.js"></script><!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="bootstrap.min.css"/>
<script src="formio.full.5.3.0-rc.2.js"></script>
</head>
<body>
<div id="formio"/>
<script>
const formular = {
"components": [
{
"capture": false,
"fileTypes": [
{
"label": "",
"value": ""
}
],
"input": true,
"key": "file",
"label": "Upload",
"logic": [
{
"actions": [
{
"customAction": "console.log(arguments[20][0]);",
"name": "fileUploadingEnd",
"type": "customAction"
}
],
"name": "fileUploadingEnd",
"trigger": {
"event": "fileUploadingEnd",
"type": "event"
}
}
],
"storage": "base64",
"tableView": false,
"type": "file",
"validateWhenHidden": false,
"webcam": false
}
]
};
Formio.createForm(document.getElementById('formio'), formular);
</script>
</body>
</html>
If I add on the row 1086 ( https://github.com/formio/formio.js/blob/v5.3.0-rc.2/src/components/file/File.js#L1086 ) this:
this.emit('fileUploadingEnd', fileInfo);
in the oposite of this:
this.emit('fileUploadingEnd');
It is ok.
Metadata
Metadata
Assignees
Labels
No labels