ycv005
Hide Modal when Back button of browser is pressed
I want to Hide full-window Modal when the back button of browser is pressed only on the particular page.
Marked As Solved
NobbZ
You haven’t mentioned LiveView before, so far we assumed regular statically rendered templates…
As far as I remember push state support has been added recently and you should be able to use that to handle back/forward buttons from your liveview.
Also Liked
alvises
As @NobbZ said, you can use pushState support in LiveView which would really make the things easy.
With pushState in LiveView, when you show a modal you can update the URL (to something like /page/modal) without refreshing/changing the page. This new url is added to the browser history so when users click the back button they go back to the previous state (there are two examples on an article I wrote).
ycv005
Ya, I also saw your videos. Thanks to all.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









