According to phoenix doc:
For live page navigation via
live_redirect
andlive_patch
, as well as form submits viaphx-submit
, the JavaScript events"phx:page-loading-start"
and"phx:page-loading-stop"
are dispatched on window.
And I can use the 2 events to turn on and off onebar nicely. However, for form submission that invlolve password update, there is some non-negligible time spent on password hashing in Argon2. During this time, the progressbar is not showing. It may confuse my user. How can I somehow turn on the progressbar earlier, like as soon as the form submission is triggered?