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

    mammoth-family-48524

    08/21/2022, 10:39 AM
    I've asked for help in Shoelace's discussion forum as well https://github.com/shoelace-style/shoelace/discussions/866
  • b

    blue-ghost-19146

    08/21/2022, 11:42 AM
    The README in the htmx github repo says to "use node 15 and run `npm install`" for local development, but the node-sass version in the
    package-lock.json
    is only compatible with node 14 or lower. I really don't know much about JS modules/dependencies etc, but using Node 14 did work for me. Do the docs or the package-lock.json need updating?
  • r

    ripe-action-67367

    08/21/2022, 12:02 PM
    https://discord.com/channels/725789699527933952/725789747212976259/999997871367651329
  • r

    ripe-action-67367

    08/21/2022, 12:02 PM
    I just remove node-sass from package.json when developing
  • b

    blue-ghost-19146

    08/21/2022, 12:05 PM
    Lovely, that works too, cheers!
  • b

    blue-ghost-19146

    08/21/2022, 12:06 PM
    This is my first contribution to htmx (or any public repo really) - shall I checkout a new branch off of dev and then open a PR to merge into it?
  • m

    mysterious-toddler-20573

    08/21/2022, 1:55 PM
    I looked at this, and I think it should be working, I need to debug locally. https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L2724
  • m

    mysterious-toddler-20573

    08/21/2022, 1:55 PM
    this is the line I expect it to halt the request on when a validation fails
  • m

    mysterious-toddler-20573

    08/21/2022, 1:55 PM
    but I need to debug
  • h

    happy-knife-63802

    08/21/2022, 2:20 PM
    Cheers for looking at it, happy to test as needed
  • m

    mysterious-toddler-20573

    08/21/2022, 2:38 PM
    OK, found the culprit: https://github.com/bigskysoftware/htmx/commit/3325a9e6ab61a95e4cc6a7b72e8919217e2e6374
  • b

    blue-ghost-19146

    08/21/2022, 2:38 PM
    I’ve forked the htmx repo and want to open a PR against dev, but it’s picking up 35 previous commits & 49 changes filed (my changes or one commit, three files). When I preview it against master, the correct diff is shown. Any idea why?
  • m

    mysterious-toddler-20573

    08/21/2022, 2:38 PM
    looks like I tried doing validation on everything at one point and it didn't go well
  • m

    mysterious-toddler-20573

    08/21/2022, 2:39 PM
    maybe we should have an
    hx-validate
    attribute
  • m

    mysterious-toddler-20573

    08/21/2022, 2:39 PM
    to allow you to override the default behavior
  • m

    mysterious-toddler-20573

    08/21/2022, 2:50 PM
    can you link to your repo?
  • b

    blue-ghost-19146

    08/21/2022, 2:52 PM
    I’m going to delete, fork again and go through the steps again. Will come back with a link if it’s still an issue
  • h

    happy-knife-63802

    08/21/2022, 2:59 PM
    Would such an hx-validate work against an individual input rather than the entire form on submit? If so that sounds better than something like on change[valid] syntax wise
  • m

    mysterious-toddler-20573

    08/21/2022, 3:01 PM
    yep
  • m

    mysterious-toddler-20573

    08/21/2022, 3:02 PM
    Copy code
    js
                // only validate when form is directly submitted and novalidate or formnovalidate are not set
                // or if the element has an explicit hx-validate="true" on it
                var validate = (matches(elt, 'form') && elt.noValidate !== true) || getAttributeValue(elt, "hx-validate") === "true";
                if (internalData.lastButtonClicked) {
                    validate = validate && internalData.lastButtonClicked.formNoValidate !== true;
                }
  • e

    echoing-nest-31408

    08/21/2022, 3:29 PM
    Thanks for the tips, just tried morphdom and didn't seem to help. Though not 100% sure it's being used. No errors in console, is there a way I can verify that morphdom is actually being used? I did try hx-post on the buttons with hx-target that differs, but it just didn't seem to use that target while the buttons had hx-trigger="submit". If I changed to hx-trigger="clicked" (iirc), then it used the button's hx-target, but then the form doesn't get submitted with the button's submit value which breaks other things.
  • h

    happy-knife-63802

    08/21/2022, 4:01 PM
    Delicious!
  • b

    blue-ghost-19146

    08/21/2022, 4:09 PM
    Right, ignore my earlier stupidity! PR is up for allowing "unset" to be used with hx-vals/hx-vars: https://github.com/bigskysoftware/htmx/pull/1013
  • m

    mysterious-toddler-20573

    08/21/2022, 4:19 PM
    what does your html look like?
  • r

    rhythmic-shoe-62185

    08/21/2022, 6:39 PM
    i am early on a project i have somewhat jokingly referred to as an "htmx-first" framework. what i mean by that is, how would you build a new web framework if you could assume the premises of htmx? (i.e., that HTTP and browsers have evolved together, more verbs acting on more elements and attributes, etc.) it's possible the answer is, "not any different than regular web frameworks". i'm interested in what the community thinks about this. ease of producing partials for responses (toggling layouts on/off) feels like a biggie, in part because many existing frameworks require a fair bit of wiring to add new URL paths & templates, whereas htmx wants many of each. any other features of a server-side framework that would ease development of an htmx-based site?
  • m

    mysterious-toddler-20573

    08/21/2022, 7:19 PM
    I think the most crucial thing would be "inline partials"
  • m

    mysterious-toddler-20573

    08/21/2022, 7:19 PM
    that is, the ability to have a single html template and be able to render only chunks of it
  • a

    aloof-crayon-56651

    08/21/2022, 7:22 PM
    I was in the middle of learning SCSS when I discovered HTMX. Came here to ask questions and someone suggested Tailwind. I was skeptical (and also had the sunken cost of going deep into SCSS already), but gave it a go was convinced after trying it.
  • e

    echoing-nest-31408

    08/22/2022, 6:40 AM
    I tried putting hx-swap in a handful of places: https://gist.github.com/saward/649558eedfbe2c826312728b69dd3d30. The input I'm testing with is the one with the id "dependents[0][age]". On the content div that gets swapped, on the form, and (not in this example) the input itself.
  • l

    loud-action-20310

    08/22/2022, 9:23 AM
    getting this error on hx-boosted click, and it prevents correct scroll to top of the element 🤔
1...790791792...1146Latest