Uncaught (in promise)
error when rejecting modal's beforeClose()
promise
#6381
Labels
4 - verified
Issues that have been released and confirmed resolved.
ArcGIS Field Apps
Issues logged by ArcGIS Field Apps team members.
bug
Bug reports for broken functionality. Issues should include a reproduction of the bug.
estimate - 3
A day or two of work, likely requires updates to tests.
p - low
Issue is non core or affecting less that 10% of people using the library
Milestone
Actual Behavior
Returning a rejected promise from a modal's
beforeClose()
callback causes anUncaught (in promise)
error to be logged in the devtools console.Expected Behavior
Returning a rejected promise from a modal's
beforeClose()
callback does not log an error.Reproduction Sample
https://codepen.io/nwhittaker-esri/pen/dyjqzqP
Reproduction Steps
Reproduction Version
1.0.3
Relevant Info
Stack trace:
Regression?
No response
Impact
The modal's
beforeClose()
callback is an affective way to cancel closing a modal if some precondition is not met. For example, the Field Maps web app has some modals that may need to confirm some data loss before closing. If the user ends up not confirming, the modal should not close. This flow is achievable by having thebeforeClose()
callback return a rejected promise.In this scenario, the rejected promise does not represent an exceptional state. Not catching it introduces a couple problems:
Esri team
ArcGIS Field Apps
The text was updated successfully, but these errors were encountered: