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

    mysterious-toddler-20573

    09/22/2022, 4:16 PM
    Not as of yet
  • m

    mysterious-toddler-20573

    09/22/2022, 4:17 PM
    hard to say exactly what you want, but it might be better to listen for all those events with a different tool (e.g. hyperscript or alpine) and then trigger a single event on your element. I've used this pattern before to good effect.
  • t

    tall-dinner-62086

    09/22/2022, 4:18 PM
    I'm not entirely sure how I did it, but I think it was a combination of
    hx-target="body" hx-select="body"
    and oob swaps.
  • m

    mysterious-toddler-20573

    09/23/2022, 12:59 AM
    check it: https://discord.com/channels/725789699527933952/909436816388669530/1022639175624839219
  • m

    mysterious-toddler-20573

    09/23/2022, 3:51 AM
    https://twitter.com/htmx_org/status/1573156869367021571
  • m

    mysterious-toddler-20573

    09/23/2022, 3:51 AM
    @melodic-advantage-28381 's talk is absolute 🔥
  • a

    adamant-state-54102

    09/23/2022, 4:23 AM
    One of my favorite things... I have no build step.
  • a

    adamant-state-54102

    09/23/2022, 4:29 AM
    Question: Is it possible to use htmx to add certain form inputs into the query string of a link? That is, I am not `hx-get`ing... I want to do a normal full page refresh when clicking a link, but I want the href to dynmically include the ids from a set of checkboxes the user might have checked.
  • i

    important-van-94053

    09/23/2022, 6:10 AM
    Hey @melodic-advantage-28381 - Have you got the slides handy yet? Otherwise I’ll wait for the replay on DjangoCon’s YT channel 🙂 Several folks asking for it in the comments of those tweets, I’m certainly one of them!
  • f

    freezing-waitress-26396

    09/23/2022, 6:44 AM
    hx-include
    https://htmx.org/attributes/hx-include/
  • f

    freezing-waitress-26396

    09/23/2022, 6:44 AM
    combined with
    hx-get
  • p

    proud-librarian-99598

    09/23/2022, 8:11 AM
    If I have
    HX-Refresh: true
    on a 302 response, I would expect htmx to do a full page refresh, but this is not what I see, there is no full page reload. Is this a bug?
  • t

    tall-dinner-62086

    09/23/2022, 8:17 AM
    What version of htmx are you on?
  • p

    proud-librarian-99598

    09/23/2022, 8:29 AM
    1.7.0
  • t

    tall-dinner-62086

    09/23/2022, 8:31 AM
    Yeah should be working. Do you have any event listeners that might be interfering with the response?
  • t

    tall-dinner-62086

    09/23/2022, 8:32 AM
    Try HX-Redirect
  • p

    proud-librarian-99598

    09/23/2022, 8:45 AM
    Not working either unfortunately:
  • p

    proud-librarian-99598

    09/23/2022, 8:46 AM
    I have now also updated to 1.8.0 of htmx, but same result.
  • t

    tall-dinner-62086

    09/23/2022, 8:46 AM
    And that's for sure an htmx request
  • t

    tall-dinner-62086

    09/23/2022, 8:46 AM
    These were added with 0.4.0, I was just making sure you weren't somehow really outdated
  • p

    proud-librarian-99598

    09/23/2022, 8:47 AM
    Yeah, it is a htmx request. The request headers in Chrome of that same request have a bunch of HX-... headers
  • t

    tall-dinner-62086

    09/23/2022, 8:50 AM
    Just tested on my machine, things "just work"™️. Do you have any errors in the console?
  • p

    proud-librarian-99598

    09/23/2022, 9:14 AM
    There is an error about CORS because htmx follows the 302
  • p

    proud-librarian-99598

    09/23/2022, 9:15 AM
    htmx should give priority to the
    HX-Refresh
    or
    HX-Redirect
    over following the 302
  • p

    proud-librarian-99598

    09/23/2022, 9:22 AM
    Did you try with a response that gives a 302 status ?
  • t

    tall-dinner-62086

    09/23/2022, 9:24 AM
    Ah no, I had mistakenly returned 200. With a 302, htmx does indeed first try to follow the location header
  • p

    proud-librarian-99598

    09/23/2022, 9:25 AM
    Could this be changed somehow?
  • t

    tall-dinner-62086

    09/23/2022, 9:38 AM
    I'm not sure
  • s

    stocky-dentist-80693

    09/23/2022, 9:40 AM
    I don't think so, it's the browser that interprets and acts on the 302 before htmx has a chance to see it. As I understand it.
  • t

    tall-dinner-62086

    09/23/2022, 9:40 AM
    I've set up a codepen that illustrates what I'm trying to do. I have a menu that uses
    <details>
    tags for submenu folding. I want to be able to maintain the state of each details tag (open/closed) when a user clicks a link, while also swapping in each individual menu item that has changed from active to non-active and vice-versa. https://codepen.io/36864-the-styleful/pen/jOxGwVr?editors=1001
1...833834835...1146Latest