carlosescri

carlosescri

LiveView DOM patching in webcomponents with slotted content

Hi all!

I’ve been working on some RAW (no framework) web components for one of our projects to see how well they behave with Phoenix LiveView.

At the time I have:

  • Custom tooltips (no problem)
  • Phone Input with country dropdown picker (no problem), Form Associated Custom Element (FACE), so it works with forms as any other input.
  • Custom Select (with search and a slot to put custom HTML nodes). FACE too.

I had some problems with the slotted elements in the custom select because they were not patched by morphdom.

With a bit of help from Claude y proposed a fix in the live view repo.

You can get more details here:

If any of you is interested on this topic because you suffered from this problem too, would be great if you can give a try so @steffend can get some feedback because this is actually a bit tricky.

I encourage you to take a look at the PR. It’s up to date to 1.2.6 version of LV and it has some tests. More details in the PR.

Thank you for your time.

Where Next?

Popular in Thoughts On... Top

pera
Releases is a fantastic new feature in Elixir 1.9, but it comes with one important caveat: Once a release is assembled, it can be packa...
New
W3NDO
I went back to building on ruby during an interview and I was asked to explain symbols. It got me thinking about ruby symbols and elixir ...
New
mszmurlo
Recently ‘discovered’ the reduce: option for comprehensions. Very useful, yet there is a syntax difference between into: and reduce: that...
New
carlosescri
Hi all! I’ve been working on some RAW (no framework) web components for one of our projects to see how well they behave with Phoenix Liv...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
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 42158 114
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
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
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54250 245
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

We're in Beta

About us Mission Statement