sidjainn
While trying to override the default confirm behaviour of phoenix.link.click in live view, the operation happens already without waiting for confirmation from the user. I’m using vex for creating custom confirm dialog like in the docs below.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Sakthibalan
Me too facing the same problem, Please anyone can help us.
oladipo
has anyone been able to resolve this one?
greenlobster
Still an issue in 2022
. Following the exact instructions with vex leads to the click event happening anyway, regardless of the vex prompt.
kerryb
I came across this thread while seeing the same issues (in 2024). I think it might have been caused by not loading the vex css. In case it helps anyone, this is the working setup I ended up with (this is an old project using webpack – I assume it’ll be a bit different with esbuild):
New file
assets/js/confirm_dialog.js(for tidyness):In
assets/js/app.js:In
assets/css/app.scss:kerryb
Sorry, replying to myself. I thought that worked, but all I’d managed to do was get the dialog to show up. The liveview still receives the click event immediately, and handles it while the dialog is still displayed.
cpwood
I believe @Neophen posted on this yesterday: Beter data-confirm modals in Phoenix LiveView - DEV Community
I have yet to try this out though.
Neophen
yeah i forgot i wanted to post this here somewhere
@kerryb the problem with the vex solution lies in the fact that e.preventDefault needs to be instant, the event handlers are instant you can’t really await on them. Hence in my implementation i prevent it if it has a data-confirm and then re-trigger on the success case, you could adjust it based on your modal/dialog, i just used the native dialog method and created promise with closures to handle the results.
Also, my implementation just puts the markup dialog into the html markup as a live component. You could put it into a template tag and create it a dialog from there. ofcourse make sure to remove the dialog after resolving it.
cpwood
Thanks for writing this, @Neophen . Works great in my tests so far!
Do you think it could work as a dep/lib? I would be happy to assist.
Neophen
Not sure it’s just two code snippets, and it really depends on the way users want to implement it.
I think what could be good is to somehow add this example to the docs, as it is just wrong in the docs.
Neophen
Created a pr
https://github.com/phoenixframework/phoenix_live_view/pull/3225/files