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

    mysterious-toddler-20573

    07/12/2022, 11:46 PM
    this sounds like it might be back end specific, is there a channel in the Stacks group that might help?
  • h

    helpful-teacher-63323

    07/12/2022, 11:49 PM
    I will try to find..... 👍
  • t

    tall-dinner-62086

    07/13/2022, 9:12 AM
    What does this mean? > The HX-Location response header now implements client-side redirects entirely within htmx
  • r

    ripe-action-67367

    07/13/2022, 10:10 AM
    https://htmx.org/headers/hx-location/
  • r

    ripe-action-67367

    07/13/2022, 10:11 AM
    Basically, HX-Redirect alternative without reloading the page
  • t

    tall-dinner-62086

    07/13/2022, 10:12 AM
    Oh right this is a new header, not a change to the hx-redirect header. My brain just went "yes, location and redirect are the same word".
  • p

    powerful-helmet-42757

    07/13/2022, 2:17 PM
    🤔 Should I be able to use
    *
    selector in
    hx-select
    ? Something like
    hx-select="#myid *"
  • t

    tall-dinner-62086

    07/13/2022, 2:24 PM
    What would you expect to happen there?
  • p

    powerful-helmet-42757

    07/13/2022, 2:25 PM
    Select everything under
    #myid
    ?
  • t

    tall-dinner-62086

    07/13/2022, 2:25 PM
    And put it where?
  • t

    tall-dinner-62086

    07/13/2022, 2:26 PM
    Or I guess in other words, how would that be different from just selecting
    #myid
  • p

    powerful-helmet-42757

    07/13/2022, 2:32 PM
    Good question! I'm building a load-more button that looks like...
    Copy code
    <a id="load-more" class="button" href="{{ url }}"
        hx-get="{{ url }}" 
        hx-swap="outerHTML" 
        hx-select="#list article, #load-more, #no-result">{{ 'THEME.PAGINATION.LOAD_MORE'|t }}
        </a>
    When swapped, the button itself is replaced by whatever should be appended to the list. I currently use
    hx-select="#list article, #load-more, #no-result"
    but was wondering if I could simply use
    hx-select="#list *"
    .
  • t

    tall-dinner-62086

    07/13/2022, 2:36 PM
    Have you tried?
  • p

    powerful-helmet-42757

    07/13/2022, 2:39 PM
    I did. And you know what? I think I fell for the oldest trick in the book.... cache
  • p

    powerful-helmet-42757

    07/13/2022, 2:39 PM
    Seems to be working.
  • t

    tall-dinner-62086

    07/13/2022, 2:39 PM
    Neat
  • b

    blue-ghost-19146

    07/13/2022, 3:19 PM
    Love it! Was just browsing the docs and saw here https://htmx.org/headers/hx-push/ that
    HX-Push
    has become
    Hx-Push-Url
    . Should this be reflected in the response headers section, which currently still refers to
    HX-Push
    ? (https://htmx.org/docs/#response-headers)
  • r

    refined-waiter-90422

    07/13/2022, 5:07 PM
    Hyperscript on HN again:
  • m

    mysterious-toddler-20573

    07/13/2022, 5:07 PM
    yes, pull request please!
  • m

    mysterious-toddler-20573

    07/13/2022, 5:34 PM
    finally got my roy fielding JSON API meme right
  • h

    hundreds-camera-24900

    07/13/2022, 8:08 PM
    I did that - I did it because django has a lot of redirect based stuff (post form/post login, ect) and I didn't want to blow away the dom when doing that
  • t

    tall-dinner-62086

    07/13/2022, 8:11 PM
    I understand it, I was only confused because in my brain I conflated hx-location with hx-redirect
  • t

    tall-dinner-62086

    07/13/2022, 8:11 PM
    When I read it I thought hx-redirect had been changed
  • e

    echoing-book-71490

    07/13/2022, 8:15 PM
    hx-select-oob
    is super interesting for the extension I built. Basically made a custom attribute doing something very similar (using a very sketchy string replace to inject
    hx-swap-oob
    into html chunks I get from the API), but it also sends the selected ids with the request. I wonder if I could somehow unify them or just lift the logic for that attribute in
    handleOutOfBandSwaps
    ?
  • e

    echoing-book-71490

    07/13/2022, 9:10 PM
    There doesn't seem to be a nice way to hook into
    handleOutOfBandSwaps
    to get
    settleInfo
    except
    handleSwap
    , which isn't called when a swap style is explicitly defined
  • l

    late-king-98305

    07/13/2022, 11:19 PM
    In docs, I don't see anything for
    HX-Replace-Url
    and there are two different links giving 404s. I do see the changes to
    HX-Push-Url
    , and I'm guessing the behavior is the same, just replaces instead of pushes. (I was going to PR to fix the links, but there's not a page under
    /www/headers
    .)
  • l

    late-king-98305

    07/13/2022, 11:23 PM
    I'm guessing the implication of the URL push on POST is that the POST-Redirect-GET pattern ends up at the right place without having to jump through some hoops? (If so, that's awesome!)
  • m

    mysterious-toddler-20573

    07/13/2022, 11:29 PM
    PR please, and yes
  • m

    mysterious-toddler-20573

    07/14/2022, 12:01 AM
    man, htmx is fun sometimes
  • a

    acoustic-autumn-94211

    07/14/2022, 12:59 AM
    Using the
    client-side-templates
    extension is there a way to run
    htmx.process
    or equivalent on the rendered output to hook up htmx behaviors / hyperscript in the template?
1...743744745...1146Latest