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

    late-king-98305

    10/04/2022, 12:15 AM
    Here's how I do it in one of my projects. The application that this expects will sometimes put error messages in a header, and those will be automatically displayed; otherwise, I create a error message (a Bootstrap toast) from the error status and message. https://github.com/bit-badger/myWebLog/blob/main/src/admin-theme/wwwroot/admin.js#L360
  • g

    green-activity-6102

    10/04/2022, 1:53 AM
    how did i miss
    htmx:responseError
    in the events list, this looks like the perfect solution
  • r

    red-farmer-97020

    10/04/2022, 2:05 AM
    Today I tried to persist state by doing some fancy oob swaps on an element that had hx-vals on it
  • r

    red-farmer-97020

    10/04/2022, 2:05 AM
    Then I kicked myself and used cookies
  • r

    red-farmer-97020

    10/04/2022, 2:06 AM
    Sometimes I forget how simple and powerful the web is without all these fancy frameworks and APIs
  • m

    most-flag-2080

    10/04/2022, 5:45 AM
    Anyone see the new Hotwire release
  • m

    most-flag-2080

    10/04/2022, 5:45 AM
    It’s insane
  • r

    refined-waiter-90422

    10/04/2022, 5:58 AM
    I did, what makes it insane? Just seems like a solid patch.
  • e

    echoing-dress-67727

    10/04/2022, 1:10 PM
    With polling triggers, is there a way to set a timeout? I know there's the 286 response code, but I'd like something client-side, in case something goes wrong, it doesn't poll indefinitely
  • p

    proud-librarian-99598

    10/04/2022, 2:00 PM
    bump
  • s

    square-analyst-94375

    10/04/2022, 4:06 PM
    If I have a modal that submits a form (hx-delete in my case), and the modal closes (via hyperscript
    remove me
    call) then I've noticed that
    HX-Trigger
    response headers are aren't triggering my hx-trigger that is watching for the event: (
    hx-trigger="requestDeleted from:body"
    ). I'm guessing that the event IS triggered on the element, but it is no longer in the DOM so it doesn't bubble up to the body. Is there a preferred work around or is this an HTMX bug? Maybe some way to wait for the http request returns before removing the modal?
    m
    • 2
    • 3
  • s

    square-analyst-94375

    10/04/2022, 4:55 PM
    If I have a modal that submits a form hx
  • m

    mysterious-toddler-20573

    10/04/2022, 6:05 PM
    https://discord.com/channels/725789699527933952/924101955746431026/1026917961908359218
  • m

    mysterious-toddler-20573

    10/04/2022, 6:07 PM
    hoping to have releases of htmx and hyperscript out next week folks. Nothing too sexy, but it will fix re-initialization of changed htmx content & when multiple elements use the same indicator (an embarrassing bug πŸ˜‘ )
  • f

    freezing-waitress-26396

    10/04/2022, 6:42 PM
    πŸ‘Œ
  • m

    mysterious-toddler-20573

    10/04/2022, 7:47 PM
    https://dev.htmx.org/test/1.8.1/test/
  • m

    mysterious-toddler-20573

    10/04/2022, 7:47 PM
    wondering if I should include idiomorph in the docs
  • m

    mysterious-toddler-20573

    10/04/2022, 8:05 PM
    https://dev.htmx.org/docs/#morphing
  • m

    mysterious-toddler-20573

    10/04/2022, 8:05 PM
    thoughts?
  • g

    green-activity-6102

    10/05/2022, 1:08 AM
    i think i know the answer to this but there's no way to delay the
    hx-indicator
    right? like for example if i wanted it only to show up when my response takes β‰₯500 ms to come back
  • g

    green-activity-6102

    10/05/2022, 1:09 AM
    sometimes when network speeds are nice and fast the indicator just kind of flashes and disappears -- would be nice for it to just never come up in those cases
  • g

    green-activity-6102

    10/05/2022, 1:10 AM
    or maybe i can use CSS transitions for this πŸ€”
  • m

    mysterious-toddler-20573

    10/05/2022, 1:15 AM
    I think you could use a CSS transition to achieve this
  • g

    green-activity-6102

    10/05/2022, 1:24 AM
    seems that the
    display
    property is not transitionable.. i cant use opacity because im using a big overlay on my table to block clicks during the request
  • f

    freezing-waitress-26396

    10/05/2022, 4:41 AM
    You could give the spinner a CSS class that uses keyframes or
    animation-delay
    property in CSS to transition from 0 opacity to 1, so whenever it shows up it does so with a 500ms delay
  • f

    freezing-waitress-26396

    10/05/2022, 4:41 AM
    no?
  • m

    most-flag-2080

    10/05/2022, 5:49 AM
    custom turbo streams are a game changer
  • p

    proud-librarian-99598

    10/05/2022, 10:12 AM
    Some SSE (Server-Sent Events) questions: 1) Is it possible to combine
    delay
    or
    throttle
    with SSE? So should
    hx-trigger="sse:somethingChangedEvent throttle:1s"
    work to only do the
    hx-get
    on that element maximum 1 time per second? 2) I notice that the
    htmx:sseMessage
    event is only emitted if there is an
    hx-trigger
    on that element with an
    sse
    prefix. What I would like to do is to add an
    htmx:sseMessage
    event listener so I can use
    event.detail.data
    to get the data from the SSE message and manually trigger the
    hx-get
    that is on the element that matches with the value in the data of the SSE message. Or alternatively, someway to do
    hx-trigger="sse:somethingChangedEvent[filterEvent()]"
    where
    filterEvent
    would get access to the data in the SSE message.
  • m

    mysterious-toddler-20573

    10/05/2022, 11:26 AM
    @gorgeous-ghost-95789 you have a customer
  • a

    ancient-shoe-86801

    10/05/2022, 3:00 PM
    I really like having that section on the docs. Tackles a specific problem (like the playing video) and showcases htmx extendability.
1...844845846...1146Latest