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

    some-solstice-89459

    12/31/2022, 10:39 PM
    you are just trying to implement active search in the application or you need the form?
  • s

    some-solstice-89459

    12/31/2022, 10:40 PM
    I mean adding method="post" in the form
  • w

    wonderful-school-81222

    12/31/2022, 10:40 PM
    Ohhh. Yeah. I'm assuming that htmx does the heavy lifting on that. Not required?
  • s

    some-solstice-89459

    12/31/2022, 10:49 PM
    to be honest, I'm not sure, just thinking this may be the problem
  • p

    proud-librarian-99598

    12/31/2022, 11:40 PM
    Happy new year to all htmx enthusiasts!
  • h

    hundreds-camera-24900

    12/31/2022, 11:53 PM
    If you don't want a form, you don't need one - that might be complicating it
  • h

    hundreds-camera-24900

    12/31/2022, 11:53 PM
    Try just doing an input with hx post on it?
  • w

    wonderful-school-81222

    01/01/2023, 12:06 AM
    Yep. That's what I did. It turns out I needed to give it a name and a type attribute for it to work?
  • h

    hundreds-camera-24900

    01/01/2023, 1:06 AM
    yeah that makes sense
  • r

    refined-waiter-90422

    01/01/2023, 9:07 AM
    New years resolutions, gents? ⏰
  • m

    mysterious-toddler-20573

    01/01/2023, 2:09 PM
    htmx 2.0 hyperscript 1.0 book published
  • m

    miniature-lizard-24702

    01/01/2023, 2:16 PM
    🤩
  • m

    miniature-lizard-24702

    01/01/2023, 2:17 PM
    A book on what?
  • m

    miniature-lizard-24702

    01/01/2023, 2:17 PM
    Hypermedia?
  • m

    mysterious-toddler-20573

    01/01/2023, 2:17 PM
    https://hypermedia.systems
  • m

    miniature-lizard-24702

    01/01/2023, 2:18 PM
    Nice. I’ll check back for the ebook
  • m

    mysterious-toddler-20573

    01/01/2023, 2:30 PM
    did you get this worked out?
  • m

    mysterious-toddler-20573

    01/01/2023, 2:32 PM
    @hundreds-cartoon-20446 is in charge of history for htmx 2.0 (not sure he's aware of this yet) so yes, but it will be mid summer before htmx 2.0 is available in beta (sorry)
  • m

    mysterious-toddler-20573

    01/01/2023, 2:35 PM
    drop
    - only issue the request for this element if there is not one already in flight
    abort
    - only issue the request for this element if there is not one already in flight and additionally, if another element issues a request while the request for this element is in flight, abort the request for this element
  • p

    proud-kangaroo-39262

    01/01/2023, 4:51 PM
    Mid summer 2023? Yeah, we are already at HTMX 1.8.4, the next version is HTMX 1.9 and then we have HTMX 2.0.
  • j

    jolly-waitress-42858

    01/01/2023, 5:04 PM
    Is there something like storybook.js for htmx ?
  • l

    limited-potato-46306

    01/01/2023, 5:22 PM
    @mysterious-toddler-20573 I have done some experimenting with hx-sync, and I don't think it works as intended when there are multiple form fields. Here is an example: Placing hx-sync="this:replace" on a form, and having multiple input fields with hx-post="/validate/...". In the docs, it says that this strategy would prioritize submitting the form over any validation request. Specifically: "When dealing with forms that contain many inputs, you can prioritize the submit request over all input validation requests using the hx-sync replace stragegy on the form tag. This will cancel any in-flight validation requests and issue only the hx-post="/store" request." While it is technically true that if you press submit all validation requests will be replaced, there are other issues, namely: - If you press submit on the form, and then change an input, the submit request is cancelled and the input validation request is issued - If you change an input field and then change another input field, the validation request for the first field is cancelled. This means that you can't reliably use hx-sync="this:replace" if your form has multiple fields. You can test this in chrome by setting the network to slow 3g and looking at the network requests. I have tried other experiments like setting hx-sync="closest form:abort" on multiple input fields, but similar issues occur. It feels like unintended behavior to me that listening to "closest form" requests fires when a child element issues a request independent of the form. Is there a way to use hx-sync, such that the input fields listen to submissions on the form, but do not interact with other input fields?
  • l

    limited-potato-46306

    01/01/2023, 5:23 PM
    I know that I could validate the whole form on submission (but that would not be very interactive) and I know that I could use alpine if I wanted an interactive form (but then I would be duplicating logic in javascript that exists on the backend and I don't want to duplicate the logic)
  • h

    hundreds-camera-24900

    01/01/2023, 5:28 PM
    Nah Im going to poke at it more tomorrow
  • l

    limited-potato-46306

    01/01/2023, 6:23 PM
    @mysterious-toddler-20573 One other option is to trigger an abort request when the form is submitted (htmx.trigger('#input', 'htmx:abort')), but the problem with this is that the trigger can only select an element, not a class. If I could put a class such as .form-input on all the inputs and then send a trigger to all elements selected by when form button is clicked, that theoretically would work too.
  • b

    big-airline-13935

    01/01/2023, 7:26 PM
    That’s not quite how semantic versioning works… X.9 is followed by X.10.
  • p

    proud-kangaroo-39262

    01/01/2023, 7:27 PM
    I aint sure if HTMX follows Semver, my own software doesnt, after X.9 is (X+1).0.
  • b

    big-airline-13935

    01/01/2023, 7:30 PM
    It does, in the sense that only major versions may introduce breaking changes.
  • p

    proud-kangaroo-39262

    01/01/2023, 7:30 PM
    I prefer the typescript versioning, after 3.9 is 4.0, after 4.9 is 5.0
  • g

    gorgeous-airport-54386

    01/01/2023, 7:31 PM
    what's the point of the dot then? couldn't you just have 39, 40, 49, 50 etc?
1...965966967...1146Latest