I'm trying to execute some code if a user decides to cancel their file selection using ng-flow, via a Upload File button. I don't know how to catch this event
I've tried using flow-file-error and flow-error directives to no avail. The code I pass in does not execute
<div flow-init="{target: '/api/InternalToolsDataSource/Incentive/Flow'}"
flow-name="obj.flow"
flow-files-submitted= "mapper.uploadFile($flow)"
flow-file-success="mapper.uploadSuccess($file, $message)"
flow-files-error="mapper.handleUploadError($file, $message)"
flow-error="mapper.handleUploadError($file, $message)"
flow-file-complete="alert('complete')">
I want to find a solution to be able to execute a function after the file selection process is cancelled through the external window that pops up. Thoughts?
According to the events listed in the flow.js documentation, there is no event for when the file selection popup is cancelled.
Since the
filesSubmittedevent only fires once a file is successfully chosen, it may be best to just wait for that event and don't attach anything else to the upload button that may put the UI in an unexpected state.Related non-flow question has some possible solutions using the
onchange/onblurevents: Cancel event on input type="file"