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

    bland-coat-6833

    01/17/2023, 1:24 PM
    Maybe some hyperscript and
    on init
    ?
  • b

    bland-coat-6833

    01/17/2023, 1:32 PM
    Or load the div flashing and then remove the flashing after the trigger? (I suppose we need to get a bit more info)
  • l

    late-king-98305

    01/17/2023, 1:37 PM
    In my experience, sometimes feedback like that can be valuable, and replying to the content of their feedback modeling the correct style can go a long way to correcting that sort of thing. Sometimes people are just having bad days, and sometimes they've just spent a lot of time on something and are exceptionally frustrated. Ignoring their venting sends it into a black hole, while meeting it with a code-of-conduct smackdown actually keeps it alive longer. Codes of conduct also seem to incentivize a whole other negative personality who lives for their enforcement. I can't remember the project, but their chat replied to ANY message that had "guys" in it with a 3-line message about using "inclusive language" (while not actually mentioning what the flagged word was). In addition to being simply insufferable, brand-new users would start out like "Hey guys, love this library. In the docs, I see it says x, but..." - only to have their very first interaction with that community be a tone-policing reply. FWIW - Carson mentioned that this has enough context that he understood the point. Issue templates might be good, but that's about as far as I would go with it, were this my project.
  • l

    late-king-98305

    01/17/2023, 1:44 PM
    This may be better in #1033024470325141594 - but it's also an area where I have no control, just opinions. 🙂
  • o

    orange-smartphone-63800

    01/17/2023, 2:04 PM
    Hey guys, how are you, I am working to integrate htmx with expressjs. I have a home page with list of cards to take me to a product, i have added the
    boosting
    variable on the tag there is a htmx.on('htmx:afterOnLoad') on the product page, when i click on a product card it moves me to the product page but it does not trigger the eventlistener, when i don't use
    boosting
    it works. Any idea why ?
  • m

    mysterious-toddler-20573

    01/17/2023, 2:06 PM
    where is the
    htmx.on('htmx:afterOnLoad')
    located?
  • m

    mysterious-toddler-20573

    01/17/2023, 2:07 PM
    w/ a boost, the event will be triggered on the
    body
    tag
  • o

    orange-smartphone-63800

    01/17/2023, 2:10 PM
    i have it like this on the product.html file
    Copy code
    htmx.on('htmx:afterOnLoad', (evt) => {
        if (evt.detail.elt.id === 'ProductContainer') {
          initApp();
        }
      });
  • o

    orange-smartphone-63800

    01/17/2023, 2:11 PM
    this is in a script tag before the
  • m

    mysterious-toddler-20573

    01/17/2023, 2:22 PM
    hmm, that seems like it should work to me
  • m

    mysterious-toddler-20573

    01/17/2023, 2:22 PM
    that should get added on the body, let me try to reproduce
  • s

    some-solstice-89459

    01/17/2023, 2:24 PM
    I had a similar situation
  • s

    some-solstice-89459

    01/17/2023, 2:24 PM
    putting it at the end of body worked
  • m

    mysterious-toddler-20573

    01/17/2023, 2:25 PM
    what is this line doing?
    Copy code
    evt.detail.elt.id === 'ProductContainer'
  • m

    mysterious-toddler-20573

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

    mysterious-toddler-20573

    01/17/2023, 2:26 PM
    can you put a console.log in there and see what the id is in the boost situation?
  • e

    echoing-action-55459

    01/17/2023, 2:26 PM
    Hey, I'm trying to create a typescript type for all the attributes, and i've been having issues solidifying some of the event, select, modifier parameters.
    request, swap, sync
    , In an ideal world I'd love clear-cut stringified json for all attributes (I know
    headers
    and
    vals
    have it). Some have a
    :
    as the delimiter like
    settle:1s
    and others have a space like
    closest div
    . I've been trying to create a well typed interface like
    disinheritAll
    (with jsx) would apply
    hx-disinherit="all"
    . I'm trying to cater to the docs, is there a possibility that this is all easier programmatically than the docs. Can you point me to the code that deserializes the attribute value? Any tips?
  • o

    orange-smartphone-63800

    01/17/2023, 2:27 PM
    just to give more context: product.html has an
    hx-get
    which will get the html of
    product_fragment.html
    when it
    afterOnLoad
    it should trigger
    htmx:afterOnLoad
    but it's not.
    evt.detail.elt.id === 'ProductContainer'
    this is to ensure which
    hx-get
    event i want to initApp
  • o

    orange-smartphone-63800

    01/17/2023, 2:27 PM
    i will test that
  • m

    mysterious-toddler-20573

    01/17/2023, 2:27 PM
    unfortunately it's a mix
  • m

    mysterious-toddler-20573

    01/17/2023, 2:28 PM
    usually space separates stand alone things and colon is used as an argument to a thing, but w/ css selectors that gets ugly
  • s

    some-solstice-89459

    01/17/2023, 2:28 PM
    also try using htmx.onLoad instead of htmx.on
  • s

    some-solstice-89459

    01/17/2023, 2:28 PM
    maybe will help
  • m

    mysterious-toddler-20573

    01/17/2023, 2:28 PM
    If you want to create a thread I can help you look at the code (it's all hand-done, welcome to working w/ code 1cg makes EBNF is for the weak)
  • t

    tall-dinner-62086

    01/17/2023, 2:30 PM
    If you're swapping the whole body element you might be in trouble
  • m

    mysterious-toddler-20573

    01/17/2023, 2:30 PM
    boosts should be innerHTML of body, so it should be OK
  • m

    mysterious-toddler-20573

    01/17/2023, 2:30 PM
    I'm betting it's the conditional
  • e

    echoing-action-55459

    01/17/2023, 2:30 PM
    @mysterious-toddler-20573 does the order to this matter
    hx-swap="innerHTML settle:100ms"
    ? Can it be
    hx-swap="settle:100ms innerHTML "
    ?
  • m

    mysterious-toddler-20573

    01/17/2023, 2:31 PM
    innerHTML should be first IIRC, one sec
  • m

    mysterious-toddler-20573

    01/17/2023, 2:31 PM
    https://github.com/bigskysoftware/htmx/blob/4419bc4c90b087cfc23c04e54e45f5e071535022/src/htmx.js#L2375
1...989990991...1146Latest