fpdcc / ccfp-asset-dashboard

CCFP Asset Dashboard
0 stars 1 forks source link

Ensure the auto save and warning both work on firefox #254

Closed xmedr closed 11 months ago

xmedr commented 11 months ago

Overview

The previous implementation of the auto save in #253 did not account for firefox's interpretation of preventDefault which always shows the warning message when navigating away, as opposed to only when errors were present. That presented issues with getting the page to wait for the form submission as well as a firefox's way of using fetch.

This fix uses navigator.sendBeacon to submit the form, ensuring that the page does wait, and that it is successfully submitted.

Connects #221

Testing Instructions