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

    mysterious-toddler-20573

    12/09/2022, 5:06 PM
    https://htmx.org/docs/#oob_swaps
  • f

    freezing-controller-74032

    12/09/2022, 5:08 PM
    Do I understand correctly that I just return the html with the necessary blocks and hx-select-oob itself finds them by id and replaces them with ?
  • m

    mysterious-toddler-20573

    12/09/2022, 5:33 PM
    you probably want hx-swap-oob, not hx-select-oob
  • a

    adorable-fish-28954

    12/09/2022, 8:27 PM
    Ended up using a built in ChartJS function to check instead of the generic one. to make it work 🙂
  • e

    early-camera-41285

    12/09/2022, 9:23 PM
    Can I change the HTMX request URL after the trigger? Something along the lines of
    Copy code
    javascript
    document.body.addEventListener('htmx:configRequest', (event) => {
            event.detail.url = '/edit/234/';
        })
  • r

    ripe-action-67367

    12/09/2022, 9:27 PM
    That's basically exactly how you can do it (property is called
    path
    ) https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L2799
  • e

    early-camera-41285

    12/09/2022, 9:51 PM
    Brilliant, that worked!
  • e

    echoing-book-71490

    12/09/2022, 10:43 PM
    It's obviously a pretty easy oversight to make in React, but it isn't that hard to construct the same situation with htmx? https://twitter.com/htmx_org/status/1601278957995044864
  • e

    echoing-book-71490

    12/09/2022, 10:43 PM
    Click on the variant selector thingie, it does an hx-get that targets the product information or what ever, you don't get a url update
  • e

    echoing-book-71490

    12/09/2022, 10:44 PM
    It's not hard to fix with htmx obviously, but in most cases it isn't in react either
  • e

    echoing-book-71490

    12/09/2022, 10:47 PM
    (you only run into this when you're not using boost but the foot gun is still there)
  • e

    echoing-book-71490

    12/09/2022, 10:53 PM
    yeah but what I described with hx-get seems like a pretty obvious way to me to implement a variant selector on a product page
  • e

    echoing-book-71490

    12/09/2022, 10:53 PM
    like when I have other state on the page I don't want to lose and can't use boost
  • e

    echoing-book-71490

    12/09/2022, 10:55 PM
    it's nice that pure html has guard rails where you'd have to go out of your way (the selectors as buttons with different values in a POST form?) to introduce this bug
  • e

    echoing-book-71490

    12/09/2022, 10:57 PM
    I like the flexibility of htmx (and being able to shoot myself in the foot) but this could lead to sites with htmx being as buggy as SPAs
  • e

    echoing-book-71490

    12/09/2022, 11:03 PM
    This tweet also completely blind sighted me. I've been thinking about html/hypertext and embedded ressources for the last couple of days and completely forgot about how it would affect urls
  • m

    mysterious-toddler-20573

    12/09/2022, 11:03 PM
    There is no system so perfect that men will not need to be good
  • m

    mysterious-toddler-20573

    12/09/2022, 11:04 PM
    you can use hx-push-url if you want to be fancy pants wrt to state on the page and still provide a good URL
  • m

    mysterious-toddler-20573

    12/09/2022, 11:05 PM
    but you are right, it is of course possible to use htmx and build a whole application around a single URL
  • m

    mysterious-toddler-20573

    12/09/2022, 11:05 PM
    😑
  • m

    mysterious-toddler-20573

    12/09/2022, 11:06 PM
    i will put in a feature where if you do that @gorgeous-airport-54386 pops out of the monitor and looks disappointedly at you
  • e

    echoing-book-71490

    12/09/2022, 11:07 PM
    There is a language barrier but I think I understand what you're getting at
  • e

    echoing-book-71490

    12/09/2022, 11:07 PM
    sure it's easy to fix
  • m

    mysterious-toddler-20573

    12/09/2022, 11:08 PM
    🙂
  • m

    mysterious-toddler-20573

    12/09/2022, 11:08 PM
    I am being flippant and unreasonable
  • e

    echoing-book-71490

    12/09/2022, 11:08 PM
    that's not necessarily a bad thing, you can probably do the same thing with iframes and anchor targets or whatever lol
  • e

    echoing-book-71490

    12/09/2022, 11:09 PM
    maybe it's about defaults and sometimes giving devs not what they expect (the url of the last hx-get in the address bar?) if it nudges them in the right direction
  • e

    echoing-book-71490

    12/09/2022, 11:12 PM
    or do that yeah, sounds like a great use of ai for detection
  • m

    mysterious-toddler-20573

    12/09/2022, 11:14 PM
    my hope is that the general hypermedia vibe will rub off on people and make them think in terms of representations of resources with unique locators
  • e

    echoing-book-71490

    12/09/2022, 11:20 PM
    the more I think about it the more I feel like what's missing is a good way for one ressource to be embedded in another, that links are not enough
1...939940941...1146Latest