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

    square-analyst-94375

    08/30/2022, 3:13 PM
    Does
    hx-trigger
    support cancelling previous requests? For example with an 'active search'. If I type 'a' that search will be slow and get a bunch of non-helpful results as the user types 'ard' then 'ardvark'. And the general searches may be slower, making the return after the precise ones. I would like HTMX to be able to cancel the previous requests so there isn't a chance of a slow request coming back later and putting its stale response in the UI.
  • m

    mysterious-toddler-20573

    08/30/2022, 3:23 PM
    https://htmx.org/attributes/hx-sync/
  • m

    mysterious-toddler-20573

    08/30/2022, 3:24 PM
    in general, htmx will synchronize requests for an element
  • m

    mysterious-toddler-20573

    08/30/2022, 3:25 PM
    so if you type
    a
    and it takes a while, it will wait until that request finishes. You can modify this behavior w/
    hx-sync
  • a

    adamant-salesmen-67924

    08/30/2022, 3:25 PM
    @mysterious-toddler-20573 I'm terribly curious. If you are so active in your discord channel, writing up though provoking blog posts, maintaining two major open source libraries (and all that entails).......what's your day job? 😆
  • m

    mysterious-toddler-20573

    08/30/2022, 3:25 PM
    i teach at a university and consult 😑
  • a

    adamant-salesmen-67924

    08/30/2022, 3:25 PM
    In what country?
  • m

    mysterious-toddler-20573

    08/30/2022, 3:26 PM
    in Montana, USA
  • a

    adamant-salesmen-67924

    08/30/2022, 3:26 PM
    ha, I'm in Idaho, fun 🙂
  • m

    mysterious-toddler-20573

    08/30/2022, 3:26 PM
    general vibe:
  • a

    adamant-salesmen-67924

    08/30/2022, 3:26 PM
    So you use htmx and hyperscript to keep your sanity then correct?
  • m

    mysterious-toddler-20573

    08/30/2022, 3:26 PM
    it's a working theory
  • a

    adamant-salesmen-67924

    08/30/2022, 3:28 PM
    What's your goto server side language?
  • m

    mysterious-toddler-20573

    08/30/2022, 3:31 PM
    🤔
  • m

    mysterious-toddler-20573

    08/30/2022, 3:31 PM
    i programmed in rails for a long time
  • m

    mysterious-toddler-20573

    08/30/2022, 3:31 PM
    before that, java
  • m

    mysterious-toddler-20573

    08/30/2022, 3:32 PM
    right now mostly java but that's a long story
  • a

    adamant-salesmen-67924

    08/30/2022, 3:32 PM
    Anyone who codes in Java usually has a long story to go with it 🙂
  • m

    mysterious-toddler-20573

    08/30/2022, 3:32 PM
    fact
  • g

    green-army-74971

    08/30/2022, 3:57 PM
    hey guys, does anyone have any solution for the issue described here? https://github.com/bigskysoftware/htmx/issues/777 (not my post)
  • g

    green-army-74971

    08/30/2022, 3:58 PM
    basically, i am changing an element's hx-post with javascript, in response to user actions. (specifically, i'm using alpine to set it reactively according to some page state.) however, htmx only picks up the first value it sees - changing hx-post after that doesn't change the actual url that the element posts to. is there some way to get htmx to look anew at an element's hx- attributes, not using its cache? htmx.preview() doesn't update anything after it first processes the element. (willing to do what it takes, including any hacky undocumented not-part-of-the-interface solutions.)
  • a

    adamant-salesmen-67924

    08/30/2022, 4:20 PM
    did you use set a header for
    HX-Push: /newurl
    ?
  • a

    adamant-salesmen-67924

    08/30/2022, 4:22 PM
    oh wait nm, different thought 🙂
  • g

    green-army-74971

    08/30/2022, 4:25 PM
    yeah, think that's close, but not actually the same thing
  • g

    green-army-74971

    08/30/2022, 4:26 PM
    i've got a possible solution going here, not sure yet... basically screwing around in the internals... i'm going to reach in and mutate element['htmx-internal-data'], either unset initialized or update the path value manually
  • a

    ancient-shoe-86801

    08/30/2022, 4:30 PM
    Thanks for bringing up this pattern. I am used to Jinja2 which allows to embed templates inside other templates, but that's a completely different thing.
  • r

    ripe-action-67367

    08/30/2022, 4:42 PM
    ~~ASP.NET Core Razor has multiple implementations of fragments with different capabilities, of which Partial views and view components can be returned as a result from controller https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-6.0#declare-partial-views https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-components?view=aspnetcore-6.0#invoke-a-view-component-directly-from-a-controller~~
  • r

    ripe-action-67367

    08/30/2022, 4:42 PM
    oohh
  • g

    green-army-74971

    08/30/2022, 4:43 PM
    no joy: seems that listeners are already set up to post to the given url by that point? changing htmx-internal-data doesn't seem to affect them
  • r

    ripe-action-67367

    08/30/2022, 4:43 PM
    wait, I misunderstood the article a bit, missed the important part
1...801802803...1146Latest