Fork me on GitHub
#fulcro
<
2023-05-30
>
daemianmack13:05:51

how would one express the data-popover bit of the following HTML in fulcro dom forms? i’m trying to integrate a tailwind popover lib.

<div data-popover id="popover-default"

tony.kay17:05:36

I assume data-popover is a js map?

tony.kay17:05:18

(div (merge {:id "popover-default} (js->clj data-popover)) …)

daemianmack21:05:19

it’s a data attribute. top code snippet https://flowbite.com/docs/components/popover/ shows it in action

daemianmack21:05:56

it’s necessary for interop with this js lib but not sure how to express it in fulcro dom terms

Jakub Holý (HolyJak)10:05:23

Isn’t it the same as setting (div {:data-popover true ...} ...) ?

👆 2
daemianmack11:05:22

it might be. i’m having other difficulties with the lib, so testing is currently inconclusive. will circle back if i can prove/disprove that form works. thanks!

daemianmack12:05:30

can confirm: {:data-popover "true"} has the intended effect. what was preventing me from confirming that was that the js lib only works on elements already on-page when it loads, which, they often won’t be.