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

    boundless-vase-80440

    01/25/2023, 1:39 PM
    can you show some code?
  • f

    fancy-elephant-10660

    01/25/2023, 2:03 PM
    thx I think I fixed it. The important not is that the dom get stored in localstorage
  • t

    thankful-sugar-81945

    01/25/2023, 2:41 PM
    Happy to continue the conversation here if anyone has any ideas!
  • a

    adventurous-ocean-93733

    01/25/2023, 3:44 PM
    I’ve done a bit of work on making sites look and work well for NoJS users. Hamburger menus are possible without JS by using some clever CSS. The features of htmx are a dream for this because they just get ignored by noJS users and you can post to new pages (or even frames!) WIP example: https://domainverification.org
  • a

    adventurous-ocean-93733

    01/25/2023, 3:46 PM
    Example of animating without JS: https://jsfiddle.net/elliottinvent/hL9pa1mk/10/
  • o

    orange-umbrella-16693

    01/25/2023, 3:49 PM
    That is pretty damn smart
  • s

    some-solstice-89459

    01/25/2023, 6:20 PM
    There is a way for me to get the details of the event that triggered a htmx request?
  • o

    orange-umbrella-16693

    01/25/2023, 6:20 PM
    On the server side or on the JS side?
  • m

    mysterious-toddler-20573

    01/25/2023, 6:29 PM
    in what context?
  • m

    mysterious-toddler-20573

    01/25/2023, 6:29 PM
    before the requests is made client side, server side, etc?
  • s

    some-solstice-89459

    01/25/2023, 6:36 PM
    server side
  • s

    some-solstice-89459

    01/25/2023, 6:37 PM
    it's a custom event that is triggered with custom parameters
  • s

    some-solstice-89459

    01/25/2023, 6:37 PM
    and I would like to receive them in the server
  • m

    mysterious-toddler-20573

    01/25/2023, 6:40 PM
    OK, lemme slap an example together for you
  • m

    mysterious-toddler-20573

    01/25/2023, 6:54 PM
    https://codepen.io/1cg/pen/LYBmRRN?editors=1001
  • m

    mysterious-toddler-20573

    01/25/2023, 6:54 PM
    hope this makes sense
  • m

    mysterious-toddler-20573

    01/25/2023, 6:54 PM
    I used hyperscript, but the javascript would be similar
  • s

    some-solstice-89459

    01/25/2023, 6:56 PM
    yeah, that makes sense, thank you
  • s

    square-analyst-94375

    01/25/2023, 7:52 PM
    Here is a codepen that is swapping an element's outerHTML, but it is showing a 'swap error'. Any ideas what the error is, the swap seems to be working. https://codepen.io/checketts/pen/bGjMBeP?editors=1001 Is this a bug in HTMX?
  • a

    adventurous-ocean-93733

    01/25/2023, 8:52 PM
    This was driving me a bit mad, so I put it in an S3 bucket to rule out any CodePen jiggery pokery and it works: https://pub-7eecba49185d4bf2a5da1ad8599b6e4f.r2.dev/index.html
  • a

    adventurous-ocean-93733

    01/25/2023, 8:52 PM
    (I had to change the URLs to files e.g.
    2/index.html
    )
  • r

    refined-pillow-25368

    01/25/2023, 8:54 PM
    Can I not access the return codes/html when I issue a request with the javascript api?
    Copy code
    try{
        htmx.ajax('PUT', '/api/wedding/31/saveSettings', {target: '#toast',source:'#settings-form'}).then((r,err) => {
            console.log(r)
            console.log(err)
        })
    }catch (e) {
      console.error(e)
    }
    m
    • 2
    • 9
  • a

    adventurous-ocean-93733

    01/25/2023, 8:56 PM
    The behaviour is the same as the CodePen, but it's not raising the error.
  • r

    ripe-action-67367

    01/25/2023, 9:04 PM
    https://htmx.org/attributes/hx-vals/ > When using evaluated code you can access the event object. This example includes the value of the last typed key within the input. beware xss and such
  • m

    mysterious-toddler-20573

    01/25/2023, 9:05 PM
    https://twitter.com/htmx_org/status/1618354105470300160
  • a

    adventurous-ocean-93733

    01/25/2023, 9:49 PM
    Smithsonian is "_a community of learning and an opener of doors. Join us on a voyage of discovery_" should be the intro for the htmx Discord
  • s

    square-analyst-94375

    01/25/2023, 11:33 PM
    So must be some sort of race condition with codepen? I had an hx-target bug I wanted to display on there. I'll just setup a github pages repo and demonstrate it there then
  • a

    adventurous-ocean-93733

    01/25/2023, 11:43 PM
    Ah, so you had a bug trying to demonstrate a bug? Love it when that happens.
  • s

    square-analyst-94375

    01/26/2023, 12:16 AM
    OK so I see the bug on github as well: https://checketts.github.io/htmx-demos/hx-trigger-bug/ So there could be a bug with demo.htmx.org /mocking
    a
    • 2
    • 14
  • b

    busy-action-85810

    01/26/2023, 2:09 AM
    What is the best way to trigger on a enter keyup event? I'm trying to use:
    hx-trigger="keyup[enterKey]"
    but keep ending up with a field that gets triggered with arrow keys, delete keys, etc.
1...997998999...1146Latest