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

    abundant-coat-35982

    01/02/2023, 9:05 PM
    Interesting
  • b

    boundless-vase-80440

    01/02/2023, 9:08 PM
    kinda feels "Citrixy"
  • r

    ripe-actor-72844

    01/02/2023, 9:33 PM
    thanks everyone!
  • i

    important-van-94053

    01/02/2023, 9:58 PM
    I think an interactive map might not be at its core an appropriate hypermedia use case. The question might be what the interface between a JS-heavy map and its hypermedia surroundings should be. I’ve seen the #975839826559508510 and the blog mention events: have the map output events which trigger hypermedia requests to update HTML where appropriate. Eg if the threads are shown outside the map (different section, different page, etc), clicking on the marker could trigger a view-thread event and this could trigger an hx-get with an hx-target pointed at a div on the side, or the main page content if the thread takes over the whole page. If that marker is an actual then it’s even easier, the click event is builtin https://htmx.org/essays/hypermedia-friendly-scripting/ And so, the choice of tool or library would be also guided by how “hypermedia friendly” it is, ie if it has a “rich event model” (using the terms from that essay). Not sure if there’s an existing JS map library that fits this description. But the book has an example of turning a more usual callback into an event trigger: https://hypermedia.systems/book/client-side-scripting/#_integrating_using_events
  • i

    important-van-94053

    01/02/2023, 10:01 PM
    Incidentally I may have to implement something similar in the next few months which is why I’ve already tried to think it through, and that’s the approach I think we’re going to use, seems to make sense (if using an SPA framework I would probably also implement this with events —
    <Map bind:marker-clicked=…>
    )
  • h

    hundreds-camera-24900

    01/02/2023, 10:09 PM
    I am helping a jr with some code and he has a pattern of making a form, attaching an hx-get/post to it and then using an input submit
  • h

    hundreds-camera-24900

    01/02/2023, 10:09 PM
    this ends up submitting the form and not actually triggering the hx request - I might suggest that the default trigger for forms include submit so that he doesn't have to think about submit vs button?
  • h

    hundreds-camera-24900

    01/02/2023, 10:11 PM
    my fix has been to switch it from hx-get to method=get + action and letting it be boosted
  • m

    mysterious-toddler-20573

    01/02/2023, 10:19 PM
    default trigger for forms should be submit
  • m

    mysterious-toddler-20573

    01/02/2023, 10:19 PM
    or am I misunderstanding?
  • h

    hundreds-camera-24900

    01/02/2023, 10:21 PM
    hm possible I'm doing something wierd
  • h

    hundreds-camera-24900

    01/02/2023, 10:21 PM
    I'll try to put together a test case
  • h

    hundreds-camera-24900

    01/02/2023, 10:22 PM
    this guy really did a lot of silly subtle things that broke things and it's been hard hunting them all down
  • h

    hundreds-camera-24900

    01/02/2023, 10:31 PM
    does a swap throw an error if you use hx-select and target the top most element?
  • h

    hundreds-camera-24900

    01/02/2023, 10:31 PM
    I will also put a test together for that
  • h

    hundreds-camera-24900

    01/02/2023, 10:32 PM
    ah no nm, I think this is the same bug
  • h

    hundreds-camera-24900

    01/02/2023, 10:32 PM
    the enter/vs click
  • h

    hundreds-camera-24900

    01/02/2023, 10:32 PM
    which I am going to try to debug now
  • h

    hundreds-camera-24900

    01/02/2023, 10:36 PM
    with click on button: http://controlc.com/b359c827
  • h

    hundreds-camera-24900

    01/02/2023, 10:37 PM
    with enter in form input: http://controlc.com/71a3c121
  • m

    mysterious-toddler-20573

    01/02/2023, 11:02 PM
    mmm
  • m

    mysterious-toddler-20573

    01/02/2023, 11:02 PM
    looks like an email input doesn't support
    setSelectionRange
  • h

    hundreds-camera-24900

    01/02/2023, 11:04 PM
    it doesn't, and that's an error - but it only happens post swapError
  • h

    hundreds-camera-24900

    01/02/2023, 11:04 PM
    it looks like when I hit enter htmx drops the htmx-request class on the form, but when clicking submit button it doesn't
  • m

    mysterious-toddler-20573

    01/02/2023, 11:05 PM
    😑
  • h

    hundreds-camera-24900

    01/02/2023, 11:05 PM
    I'm wondering if it doesn't like swapping out the element that's trying to do the htmx request?
  • h

    hundreds-camera-24900

    01/02/2023, 11:05 PM
    that doesn't make sense, nm
  • h

    hundreds-camera-24900

    01/02/2023, 11:06 PM
    gonna switch to debug version of htmx
  • h

    hundreds-camera-24900

    01/02/2023, 11:21 PM
    in this section: https://github.com/bigskysoftware/htmx/blob/v1.8.4/src/htmx.js#L3102
  • h

    hundreds-camera-24900

    01/02/2023, 11:22 PM
    if I click the button then I get:
    Copy code
    html
    selectionInfo.elt
    <input type=​"submit" value=​"Continue">​
1...967968969...1146Latest