Is there an existing method available to prevent live navigation? For example, when a form has changes {!Enum.empty?(@changeset.changes) via some data-confirm attribute message.
I have seen this hook example, however that only works when the window is unloaded.
The only method I can think of is broadcasting a message to my root live_view and using a Surface Context to add a data-confirm to all my live redirects links.
Thanks for the reply @cmo, I’m wondering more if there’s an existing API or a trick to intercept routing. Disabling links isn’t great for accessibility - I’d prefer the window.confirm method.
@f0rest8 Thanks for sharing your article. Yes, looks like it solves a different problem