Menkir

Menkir

Strange behaviour of Live-View rendering

Hello guys. I’ve experienced a strange behaviour of Live-View:
I have a table like this (leex):

<table>
 <thead>
  <%= live_render(:Toolbar, container: {:tr, []}) %> # render <th> entries inside <tr> container
 </thead>
 <tbody>
  <%= live_render(:Data) %>
 </tbody>
</table>

As soon as i render the table the tag inside getting rendered within the first second and then disappear immediately.
To be clear:
The html output is first:

<table>
 <thead>
 <tr class=phoenix-connected etc...>
     <th>
      entry1
     </th>
     <th>
      entry2
     </th>
 </tr>
 </thead>
 <tbody>
  ...
 </tbody>
</table>

And then it transforms like this:

<table>
 <thead>
 <tr class=phoenix-connected etc...>
  "entry1"
  "entry2"
 </tr>
 </thead>
 <tbody>
  ...
 </tbody>
</table>

Off course the view get’s messed up and nothing works properly. The thing is, that it works weeks before. Looks like an Update messes everything up. But i don’t know which module.

Did some experienced something similar and have a workaround or solution?

edit: Could it be that the render engine detects the tags as useless because it make no sense in a separate context (outside of <tr> because the engine does not know if it is part of it)?

Most Liked

Menkir

Menkir

I checked in Wireshark the http response and the html contains the <th> tag. By excluding step-by-step the javascript libraries which could be responsible for this bug it seems like live_view itself is causing this issue. I downgraded lv from 3730628ec1404d8a6fa61ed6b10fc52554bf067e to 09b792ad9f85331968cfbc43f8564d6c97495832 and the issue was gone. But it’s only a workaround :thinking:

Menkir

Menkir

I’ve created a Bug Report on Github. For those of you who want to be up to date: Live View Javascript Bug: Forget tags in rendering · Issue #282 · phoenixframework/phoenix_live_view · GitHub

Where Next?

Popular in Questions Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; somethi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement