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

    cuddly-keyboard-70746

    11/18/2022, 5:50 AM
    Copy code
    This is part of a broader conspiracy to make web development so annoying and difficult that we do not rise up against the elites
    Damnnnn, nice
  • c

    clean-arm-73414

    11/18/2022, 8:01 AM
    I guys, I'm having a bad morning, lol, for some reason cannot seem set the value of a specific input to '' . obviously I'm doing it wrong : I have tried :
    _="on htmx:afterRequest set #someid to ''"
    => A target expression must be writable. The expression type 'idRef' is not.
    _="on htmx:afterRequest set #someid@value to ''"
    => no error , no change visually. if i inspect the field the value is set to '' though .. I'm clearly missing something, dunno what yet.
  • a

    astonishing-barista-36240

    11/18/2022, 8:19 AM
    <input id="someid" value="foobar" _="on click set #someid@value to 'woot'">
    works for me
  • a

    astonishing-barista-36240

    11/18/2022, 8:19 AM
    so i'm guessing your trouble lies with the
    htmx:afterRequest
    . Is
    #someid
    part of the dom that is swapped in or out?
  • a

    astonishing-barista-36240

    11/18/2022, 8:20 AM
    if
    #someid
    is created as part of the htmx request swapping you should probably use a different event like
    htmx:afterSwap
    or
    htmx:afterSettle
  • c

    clean-arm-73414

    11/18/2022, 8:33 AM
    @astonishing-barista-36240 ah that might be it. thanks i will have a look, first i need more coffee 🙂
  • d

    dazzling-dusk-82436

    11/18/2022, 8:40 AM
    Mind if I convert this to a reveal.js slide and patch it into the HTMX site?
  • d

    dazzling-dusk-82436

    11/18/2022, 8:41 AM
    Google docs is ... Google docs
  • b

    boundless-vase-80440

    11/18/2022, 11:27 AM
    I missed yes Chad in the presentation. Also no mention of Chesterton. Sad.
  • d

    delightful-pager-22557

    11/18/2022, 11:47 AM
    Hi everyone, I’m kind of new to programming, and have read everything on the main site and a bunch on hear. But I’m wondering when is htmx not the right choice? I’ve heard it is when what you’re creating is application like. But what does that mean? Is there also the ability to partially implement into a react codebase for example? And bit by bit convert the code base?
  • s

    some-airline-73512

    11/18/2022, 11:47 AM
    Thank you. After 12 years of programming I find myself hating all the best practices. I found this guy's repository https://github.com/prettydiff/share-file-systems He made Windows'-like gui + p2p collaboration with zero dependencies. He also published some of his 'wisdom' https://github.com/prettydiff/wisdom You might find it interesting.
  • b

    broad-pencil-64390

    11/18/2022, 11:56 AM
    Hi! Is there is any better way to handle this use case? I have a select element with
    name="test" hx-get="" hx-push-url="true"
    (meaning it will make a GET request with whatever the current url is). If I change item twice it means I get the parameter twice like
    test=1&test=2
    . I need it to instead replace the value for
    test
    . I can hack around this by instead using
    HX-Push-Url
    response header and dedupe
    test
    on the server side, but I was thinking maybe there's a way to make htmx replace rather than add? (I know it's the standard that enables having multiple of the same key to handle multi-select etc, but still.)
  • s

    some-airline-73512

    11/18/2022, 12:32 PM
    In my layout the div has a nested and it breaks(div receives mouseout immediately). How do I fix that? https://codepen.io/alexbezhan/pen/WNyXZQe?editors=1011
    Copy code
    applescript
    <script src="https://demo.htmx.org"></script>
    
    
    <div style="background-color:red;width:500px;height:300px;padding:12px;font-size:64px"
         hx-trigger="doit"
         hx-get="/example"
         _="on mouseenter
              wait for mouseout or 1s
              if the result is not a MouseEvent
                trigger doit">
      <p>
      Move mouse into me and wait a sec
      </p>
    </div>
    
    <template url="/example">
    Request Made...
    </template>
  • m

    mysterious-toddler-20573

    11/18/2022, 2:14 PM
    ah, sorry, that should be
    mouseleave
  • m

    mysterious-toddler-20573

    11/18/2022, 2:14 PM
    which does not bubble, iirc
  • w

    white-london-59674

    11/18/2022, 2:31 PM
    Am I crazy, or did I recently see something about people building a mastodon service using HTMX?
  • b

    broad-pencil-64390

    11/18/2022, 2:49 PM
    Resolved this by not relying on
    hx-get=""
    that wasn't a good way it seems 😅 instead I keep form state via
    hx-include
  • m

    mysterious-toddler-20573

    11/18/2022, 2:55 PM
    I'll probably put it up after I give the talk
  • m

    mysterious-toddler-20573

    11/18/2022, 2:55 PM
    I'll look at reveal.js!
  • d

    dazzling-dusk-82436

    11/18/2022, 2:56 PM
    You'll love it
  • d

    dazzling-dusk-82436

    11/18/2022, 2:56 PM
    You write plain HTML, and it renders it into slides
  • d

    dazzling-dusk-82436

    11/18/2022, 2:56 PM
    When It degrades it degrades to lists and sections
  • m

    miniature-lizard-24702

    11/18/2022, 3:07 PM
    grug wonder why strange gray box follows cursor, grug no have money
  • m

    miniature-lizard-24702

    11/18/2022, 3:08 PM
    I've seen this before, didn't know it was a library
  • m

    miniature-lizard-24702

    11/18/2022, 3:08 PM
    thanks
  • h

    happy-pillow-29003

    11/18/2022, 3:55 PM
    Hey folks, is there a way to have an element that only triggers on load + programmatically? Basically I have a checkbox that should trigger an ajax request, but I want to do extra stuff (checking other boxes) before the ajax request is sent to the server. I’ve tried setting
    hx-trigger="load"
    to only trigger it on initial load, and then add a
    htmx.trigger(elem, 'change')
    but this causes an infinite recursion (I guess this triggers an actual js change event?), but I just want to trigger the ajax request.
  • s

    some-airline-73512

    11/18/2022, 5:22 PM
    Thank you so much. Where can I learn all these events nuances? Without knowing these web fundamentals I’m not gonna get far
  • s

    straight-appointment-14669

    11/18/2022, 5:24 PM
    https://developer.mozilla.org/en-US/docs/Web/Events
  • t

    thankful-apartment-66679

    11/18/2022, 5:24 PM
    MDN is probably the best place https://developer.mozilla.org/en-US/docs/Web/Events
  • m

    mysterious-toddler-20573

    11/18/2022, 5:25 PM
    https://developer.mozilla.org/en-US/docs/Web/Events
1...915916917...1146Latest