Questions tagged [phoenix-live-view]

Phoenix LiveView is a feature of Elixir's Phoenix framework that enables rendering web pages on the server via HEEx templates, and updating them via websockets / Phoenix Channels. Use this tag together with [elixir] and/or [phoenix-framework] for questions specific to this feature.

Official github repository: https://github.com/phoenixframework/phoenix_live_view

138 questions
1
vote
1 answer

The data of assigns gets lost when a button is clicked in a modal

I save "current_user" to the session variable in a plug. And I have the standard, auto-generated form-component or modal of LiveView. I'm using a modal in a part of a website where only authenticated users are allowed. router: live_session…
1
vote
0 answers

live_redirect doesn't grab session correctly

I'm using Phoenix liveview and am trying to add a field to the session which holds a timezone. But I have ran into some problems. I have managed to update the session by pushing an event to the client which then updates the session with help of some…
WilliamG
  • 127
  • 2
  • 8
1
vote
0 answers

cannot convert component HeroComponent with id "hero" to HTML

I am testing this tutorial: https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html#module-live-component-blocks I want to make a dropdown menu using tailwind and live view. For now I am just trying to do the tutorial... these are my…
Greg W.F.R
  • 544
  • 1
  • 5
  • 13
1
vote
0 answers

After filtering the wrong text is displayed

I have a site where multiple interfaces and its descriptions are listed, as seen here: Yesterday I changed the description texts from German to English using the PgAdmin Postgres console, everything worked fine and as you can see is displayed…
1
vote
1 answer

Undefined Function Error after installing Phoenix Live Dashboard

I'm getting this error when trying to use Phoenix Live Dashboard [2022-04-27 10:15:55.423][][error] #PID<0.4393.0> running gerardWeb.Endpoint (connection #PID<0.4388.0>, stream id 2) terminated Server: localhost:4000 (http) Request: GET…
Pedro Neri
  • 395
  • 1
  • 5
  • 17
1
vote
1 answer

Socket rejoins again and again which causes Live View to emit events itself periodically. when using with Alpine js

Issue: Socket rejoins again and again which causes Live View to emit events itself periodically. Scenario: I have index page which contains phx-change events. When I left the page idle for sometime, the events started to triggered automatically…
1
vote
1 answer

Elixir Ecto Issue - Can't make an association between two tables?

I am trying to make an association between table. I currently have a "users" table with the following…
1
vote
1 answer

Liveview app reloading infinitely on heroku deployment

This might be a stupid question to ask but are there any extra steps I need to complete to deploy a phoenix liveview app to heroku? From official documents deployment of phoenix app was successful but converting the same page into a liveview caused…
PadmaBajra
  • 23
  • 4
1
vote
0 answers

Autocomplete using a datalist doesn't work properly with phx-change

When an option (e.g., banana) is selected from the autocomplete list populated by a datalist, the selected option (banana) is entered into the textbox as expected, but the autocomplete list is still displayed as shown in the attached image. On the…
Jason O.
  • 3,168
  • 6
  • 33
  • 72
1
vote
1 answer

Encounter error when creating a new Phoenix/Elixir project

Following the standard procedure to create a new Phoenix/Elixir project. However, encounter error during installation. Please comment how to solve this error. 0. Setting $ node -v v14.18.1 $ npm -v 6.14.15 $ elixir -v Erlang/OTP 24 [erts-12.1.2]…
madeinQuant
  • 1,721
  • 1
  • 18
  • 29
1
vote
1 answer

Routing with Heex

I'm updating the phoenix LiveView to Heex templates and I'm stuck to how to update Routing.page_path How can I correctly update to Heex template in this case?
Allan Duarte
  • 157
  • 1
  • 3
  • 14
1
vote
2 answers

Why is this liveview mounting again after being redirected to a non-liveview page?

I'm working in a project that is mostly a freshly generated web app from phx.new and phx.gen.auth. I have an index page that is non-liveview. After login, the user is redirected to the main page, which is a liveview. The expectation: After clicking…
vaer-k
  • 10,923
  • 11
  • 42
  • 59
1
vote
1 answer

Phoenix keep conn from redirecting away from Liveview

I have a Liveview with a form where the user makes a couple choices and then on submit the form shoots a post request over to a standard controller to handle the download. I have a case statement in the controller :download action that sends the…
CherryPoppins
  • 59
  • 1
  • 7
1
vote
1 answer

How do I keep my input focused when updating a live view?

I have a live view that adds a p tag with typing... when a user updates an text input in form element. I want it to remove typing.. when the user blurs out of the text input.
<%= if @typing do %>

typing...

Stephen__T
  • 2,004
  • 3
  • 25
  • 48
1
vote
2 answers

After live_redirect form does not throw phx-change

I have a problem with handling phx-change on a form in LiveView. I am creating a search field for filtering a list of objects. The field also has a reset button. It looks like this: