https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • h

    happy-knife-63802

    03/10/2023, 5:50 PM
    With hyperscript this would be as simple as โ€œon click put my.innerHTML into the previous โ€
  • g

    great-lifeguard-29000

    03/11/2023, 5:43 AM
    How would I combine a
    hx-swap-oob
    with a delete and css transition as shown in the delete row example (https://htmx.org/examples/delete-row/)? I've got everything working except for the fade. Here is my fragment that is sent for the swap (it's Clojure, but you should get the idea):
    Copy code
    (html5
      [:div {:id (format "code-block-%s" message-id)
             :style "opacity: 0; transition: opacity 1s linear;"
             :hx-swap-oob "delete"}])
    The swap works great, but happens instantaneously.
  • f

    freezing-waitress-26396

    03/11/2023, 7:44 AM
    If you look at the table in the demo:
    Copy code
    html
    <tbody hx-confirm="Are you sure?" hx-target="closest tr" hx-swap="outerHTML swap:1s">
        <tr>
    notice the
    hx-swap="swap:1s"
    on the tbody
  • r

    refined-pillow-25368

    03/12/2023, 8:08 PM
    Thanks!
  • b

    big-airline-13935

    03/13/2023, 2:16 AM
    One million lines of code, more or less.
  • r

    refined-waiter-90422

    03/13/2023, 10:46 AM
    that whole month was really good for htmx memes
  • o

    orange-umbrella-16693

    03/13/2023, 12:10 PM
    What happened to the burger menu on the mobile version?
  • s

    stocky-dentist-80693

    03/13/2023, 12:15 PM
    Somebody ate it ๐Ÿ”
  • s

    shy-zebra-22292

    03/13/2023, 1:15 PM
    When battery is below 20% it disappears so you cannot browse and your battery can last longer ๐Ÿ˜„
  • m

    mysterious-toddler-20573

    03/13/2023, 3:57 PM
    @gorgeous-airport-54386 maybe a snafu from the saas removal?
  • m

    miniature-lizard-24702

    03/13/2023, 5:37 PM
    it's the curse of big ass phones
  • m

    mysterious-vr-69200

    03/13/2023, 6:36 PM
    Hi I just found out about HTMX, looks absolutely perfect for me to use in combination with MODX CMS, Tailwind, AlpineJS and GSAP... One question I have, will it also work together with something like BarbaJS? I am loving Barba for nice page transitions lately and wonder if it would work together with HTMX....
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:39 PM
    Welcome to the party, Sir ๐Ÿ™‚ I haven't heard of Barba before, so I'm checking it out. Usually, htmx plays nicely with just about any other JS on your page. Though, you usually have to do some extra work to tell other libraries when htmx has changed something in the DOM (or vice versa)
  • m

    mysterious-vr-69200

    03/13/2023, 6:42 PM
    Yea thx as far as I understand it, Barba Basically injects the next page in the current page container, so you do not need a page refresh and can use nice GSAP animations... I am just not sure if a 'injected' page with maybe a form will be ok to use HTMX after the transition. Think it will.
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:43 PM
    Yeah. I'm reading up on it now. Barba looks pretty cool. And, since it's reloading whole "pages" it should play well with htmx, but you'll probably have to do some additional work:
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:44 PM
    1) In your transition code, you'll want to call
    htmx.process()
    to tell htmx that a new page fragment has been added to the DOM.
  • m

    mysterious-vr-69200

    03/13/2023, 6:45 PM
    Ah yes, perfect.
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:45 PM
    2) I'm not sure how Barba works with DOM changes. I'm guessing it needs some kind of function call to make them work.
  • m

    mysterious-vr-69200

    03/13/2023, 6:46 PM
    htmx.process will just basically 'reload' all elements?
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:46 PM
    Chances are, you could make a Barba plugin, and an htmx Extension that make this pretty smooth.
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:46 PM
    Yes. You pass a DOM node to
    htmx.process
    and It runs through that node (and it's descendants) and wires up htmx into all of their event handlers.
  • m

    mysterious-vr-69200

    03/13/2023, 6:47 PM
    Have not had many paying clients that want page transitions like Barba, but it's something I really want to be good at.
  • m

    mysterious-vr-69200

    03/13/2023, 6:48 PM
    It makes normal sites so damn smooth. If I now add HTMX to all my forms and search + some smooth GSAP animations... Could be nice.
  • m

    millions-state-14961

    03/13/2023, 6:49 PM
    Has anybody tried HTMX with Chromeโ€™s View Transition API (https://developer.chrome.com/docs/web-platform/view-transitions/) ? They promise this feature would be expanded to allow for transitions between full page loads, which is currently impossible.
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:50 PM
    Yeah. I'm a full-on believer in htmx. It's made all the difference in my projects.
  • g

    gorgeous-ghost-95789

    03/13/2023, 6:50 PM
    I read about an experimental "portals" spec from Chrome. It looks like this is the next iteration of that. But I can't really hold my breath to wait for everyone else to support them.
  • m

    mysterious-vr-69200

    03/13/2023, 6:56 PM
    Have not tried it, but find BarbaJS so easy and powerful for this that I don't need it for now.
  • m

    mysterious-vr-69200

    03/13/2023, 7:20 PM
    WOW just started reading HTMX animations section... I use and love Tailwind, so this will be beyond perfect for me.
  • r

    refined-manchester-67193

    03/14/2023, 1:10 AM
    Are there any instances where htmx will not respect this setting? historyCacheSize:0
  • m

    mysterious-toddler-20573

    03/14/2023, 1:21 AM
    there is a bug where if you switch to 0 and someone has existing history elements, it will not be respected iirc
1...106410651066...1146Latest