phoenixframework / phoenix_html

Building blocks for working with HTML in Phoenix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overriding the default confirm behaviour does not work as written in the docs

AlfredGranson opened this issue · comments

Following the steps in the docs: https://hexdocs.pm/phoenix_html/Phoenix.HTML.Link.html#link/2-overriding-the-default-confirm-behaviour does not work. This also doesn't work with sweet alert or any other prompt-override library. Following the exact steps with the current version of vex (4.1.0) results in the prompt opening while the click action continues. Looking at the current implementation of phoenix_html.js, this seems to happen because the script relies on the window.confirm(message) inside the "phoenix.link.click" listener to pause execution until the prompt is closed (which cannot be replicated by custom prompts).