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.
I had a perfectly running web component with slotted elements, at 1.1.9. After I updated to the newest LiveView, at the time it was 1.2.2, everything stopped working. I had to rewrite my components as stateless components… I hope your fix gets approved and we can write our web components without worry.
Thanks for your response… if you have means and time, would be great if you could try your web components (or some of them) with the JS in the PR to check if they work again… Thank you in any case.