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

    icy-branch-91772

    04/26/2023, 4:32 PM
    Which event can I use to make sure that after everything on the page has rendered that I make a part of my DOM visible. I tend to do
    htmx:afterSwap
    . But there is something that somehow redraws the form I'm targetting, and I can't figure out what it is. I have tried
    htmx:afterSettle
    but that is also not doing it... Anyone got any ideas?
  • i

    icy-branch-91772

    04/26/2023, 4:32 PM
    Copy code
    js
    $(document).on('htmx:afterSettle', function() {
        console.log('called');
        if ($('#show-cancel-button').length > 0){ 
            console.log('inside');
            $('#cancel-action').removeClass('hide');
            $('#cancel-action-button').attr('tooltip', 'Abbrechen');
        }
    });
  • b

    bland-coat-6833

    04/26/2023, 5:18 PM
    Damn it. Forgot about that
  • b

    bland-coat-6833

    04/26/2023, 5:19 PM
    πŸ˜‚
  • b

    bland-coat-6833

    04/26/2023, 5:22 PM
    Is that with jquery? Might be worth trying with
    document.addEventListener
    just in case there’s some issue there? afterSettle was what I was going to suggest so strange it’s not working
  • i

    icy-branch-91772

    04/26/2023, 5:23 PM
    So, I tried it again. And afterSettle did fix it. But I am not sure, why it didn't do that from the start...
  • i

    icy-branch-91772

    04/26/2023, 5:23 PM
    It's working with jQuery.
  • b

    bland-coat-6833

    04/26/2023, 5:30 PM
    πŸ€·πŸ»β€β™‚οΈ a win is a win πŸ†
  • t

    thousands-planet-99021

    04/26/2023, 8:23 PM
    does htmx respect
    form
    attribute of submit buttons which essentially allows a submit button to be outside form
  • m

    mysterious-toddler-20573

    04/26/2023, 8:28 PM
    if the
    hx-post
    etc. is on the form, then yes
  • m

    mysterious-toddler-20573

    04/26/2023, 8:36 PM
    a small bug fix release for 1.9.0: https://github.com/bigskysoftware/htmx/blob/v1.9.1/CHANGELOG.md#191---2023-04-16
  • m

    magnificent-barista-99118

    04/26/2023, 10:28 PM
    This quote from https://htmx.org/essays/hypermedia-driven-applications/: > By adopting these two constraints, the HDA architecture stays within the original REST-ful architecture of the web in a way that the SPA architecture does not. is so funny to me. How did we get here? Where going against everything that modern web promotes, somehow brings us right in line with the very API methodology that they all (falsely) claim to follow
  • b

    bitter-machine-55943

    04/27/2023, 1:03 AM
    Was PHAT stack already taken by Python-HTMX-Alpine-Tailwind?
  • m

    magnificent-barista-99118

    04/27/2023, 1:34 AM
    @bitter-machine-55943 great question. I really did consider it for a long time, but ultimately I think that it's not a very inclusive name.
  • b

    bitter-machine-55943

    04/27/2023, 1:36 AM
    True. Amusing name but maybe not what you want your GitHub named!
  • m

    magnificent-barista-99118

    04/27/2023, 1:41 AM
    I really did think about it! As a person of not insignificant size. I find it to be very funny, but I think it's probably better to be safe than sorry with these things
  • m

    miniature-window-68019

    04/27/2023, 1:51 AM
    could also have done PATH stack
  • m

    magnificent-barista-99118

    04/27/2023, 1:59 AM
    I also considered that, but the logo potential for PyHAT is better, and path is kinda ambiguous when said out loud
  • m

    magnificent-barista-99118

    04/27/2023, 1:59 AM
    PATH was #2 though
  • m

    magnificent-barista-99118

    04/27/2023, 2:01 AM
    https://github.com/PyHAT-stack/awesome-python-htmx/discussions/1
  • m

    magnificent-barista-99118

    04/27/2023, 2:01 AM
    Here is a discussion where I give some context and ask for opinions, if anyone wants to participate πŸ™‚
  • w

    witty-iron-33803

    04/27/2023, 3:46 AM
    the links (hx-on, ...) in the changelog are wrong, giving 404
  • i

    icy-branch-91772

    04/27/2023, 6:48 AM
    Does afterSwap get triggerd only once, or is it triggered whenever any component on the page gets swapped?
  • r

    refined-waiter-90422

    04/27/2023, 7:37 AM
    missing a bit of the path from the e11y to zola transition:
    bigskysoftware/htmx/blob/v1.9.1/attributes
    ... should be
    bigskysoftware/htmx/blob/v1.9.1/www/content/attributes
    ...
  • ~~Hello there I m trying to add htmx org
    e

    elegant-car-94755

    04/27/2023, 10:18 AM
    ~~Hello there. I'm trying to add htmx.org with webpack build (following https://htmx.org/docs/#webpack) . But I can't make it works. Entry.js
    Copy code
    import 'htmx.org';
    import './htmx.js';
    htmx.js
    Copy code
    window.htmx = require('htmx.org');
    when i console.log(window.htmx) seems available but not working. Any idea ?~~

    https://cdn.discordapp.com/attachments/725789747212976259/1101090028626640956/image.pngβ–Ύ

    • 1
    • 1
  • n

    numerous-agent-22346

    04/27/2023, 10:24 AM
    Hi, htmx works really well with webcomponents. In my project a defined a customElement named
    euro-amount
    which displays a formatted euro amount. Usage:
    <euro-amount amount="1000"></euro-amount>
    -> € 1.000 Why I do like it? From the backend (clojure code):
    [:euro-amount {amount: 1000}]
    This is a overly simple example, nevertheless you can include sophisticated UI logic either using pure javascript or hyperscript/htmx. There is only one caveat: if you mount the shadowroot you have to process it with htmx/hyperscript were you using them inside the element. On the contrary, if you are not using the shadowdom you do not need to process the dom further even if your code lives in a template. Hope this helps. Write your element once and use it client side or server side, i like it
  • r

    refined-manchester-67193

    04/27/2023, 1:03 PM
    ~~Facing a rather exotic unwanted behavior where one element is botched after a "swipe-back" on iOS/MacOS Safari. I'm attaching the video here, in the video I'm tapping on the
    Tiesto
    href in the first card. So this seems like a Safari specific issue, but I'm not sure what could be causing this. Here's the video: https://www.dropbox.com/s/j55bil8sz8rt5pn/RPReplay_Final1682600210.mov?dl=0 I already have these settings configured: ``` htmx.config.historyCacheSize = 0; htmx.config.getCacheBusterParam = true; ```~~ Has nothing to do with HTMX.
  • l

    little-state-82457

    04/27/2023, 1:15 PM
    I'm having trouble preventing this double "bounce" kind of effect that I'm seeing on iOS when I tap a
    <select>
    dropdown that's then replaced by htmx: https://github.com/piepworks/cassettenest-roadmap/issues/312#issue-1670015621 I thought I had fixed it by putting a
    delay
    on it but it's still happening, sometimes even worse than on that little screen capture. Any ideas how I could improve that?
  • m

    magnificent-boots-1658

    04/27/2023, 1:49 PM
    Hey @mysterious-toddler-20573 , whereabouts in Montana do you call home?
  • h

    hundreds-cartoon-20446

    04/27/2023, 3:06 PM
    Do the select menu options change? If not, you could replace the results only.
1...110511061107...1146Latest