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

    refined-pillow-25368

    01/28/2023, 2:16 PM
    It waits five seconds before sending the request
  • b

    bland-coat-6833

    01/28/2023, 2:25 PM
    hmm - that rings a bell. I think there's a way to tell whether there's a request in-flight
  • b

    bland-coat-6833

    01/28/2023, 2:25 PM
    Might be worth a search on this server.
  • m

    mysterious-toddler-20573

    01/28/2023, 3:20 PM
    throttle
    ? https://htmx.org/attributes/hx-trigger/
  • m

    mysterious-toddler-20573

    01/28/2023, 4:54 PM
    how do people feel about this result?
  • s

    sparse-musician-64201

    01/28/2023, 4:56 PM
    I thin kthe majority is correct, the more I develop the more I realize that turn-key solutions are important, the more config is needed for a thing the less adoption it will get.
  • s

    sparse-musician-64201

    01/28/2023, 4:57 PM
    So I guess it depends on how strongly you believe in it, if you think it should be used in a significant amount of situations then I would include it.
  • r

    refined-waiter-90422

    01/28/2023, 6:01 PM
    can't really go wrong with any option since it's only 700 lines- would be really easy to include as a prime extension because it already is.
  • r

    refined-waiter-90422

    01/28/2023, 6:03 PM
    Pretty much this, I haven't used it personally yet and would be interested to hear about real life examples of when it's useful.
  • r

    refined-waiter-90422

    01/28/2023, 6:12 PM
    If it's just another "nice to have" swap type which could be useful in specific situations- that makes me feel like extension territory, just to keep htmx simple and tiny- because simple and tiny is a major feature in its own right.
  • b

    busy-action-85810

    01/28/2023, 6:17 PM
    Hey folks, got another keyboard shortcut question. 😅 Should it be possible to combine keys together to create a global shortcut:
    Copy code
    hx-trigger="click, keyup[key == 'g' && key == 'n'] from:body"
    I'm trying to mimic the behavior of services like Shortcut (creating a new task). If I don't use the conditional, it works fine. Example:
    Copy code
    hx-trigger="click, keyup[key == 'n'] from:body"
    Is it not possible to use two keys in succession or do you always need a modifier key first?
  • r

    refined-waiter-90422

    01/28/2023, 6:19 PM
    Adding it to core would increase the source code size of htmx by ~22%, so yeah, pretty substantial from that perspective.
  • m

    mysterious-toddler-20573

    01/28/2023, 6:23 PM
    It does bring proper head merging to the table as well
  • m

    mysterious-toddler-20573

    01/28/2023, 6:23 PM
    Still thinking
  • r

    rapid-oyster-80114

    01/28/2023, 6:28 PM
    Hello, Would you please tell me how to properly initialize TinyMCE to work with htmx? In my base html I have the following code: htmx.on("htmx:load", function (content) { tinymce.init({ selector: 'textarea#tinymce', toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image', menubar: false, automatic_uploads: false, }); }); But it works only initially. After clicking any with hx-boost the TinyMCE editor textarea does not appear (I need to refresh the whole page).
  • b

    breezy-salesclerk-70879

    01/28/2023, 9:37 PM
    yo guys
  • b

    breezy-salesclerk-70879

    01/28/2023, 9:37 PM
    htmx docs are down
  • g

    gorgeous-airport-54386

    01/28/2023, 9:37 PM
    works here
  • b

    breezy-salesclerk-70879

    01/28/2023, 9:38 PM
    uuh
  • b

    breezy-salesclerk-70879

    01/28/2023, 9:38 PM
    it had a sudden break then
  • b

    breezy-salesclerk-70879

    01/28/2023, 9:38 PM
    maybe your presence did fix it @gorgeous-airport-54386
  • b

    breezy-salesclerk-70879

    01/28/2023, 9:38 PM
    thanks!
  • m

    mysterious-toddler-20573

    01/28/2023, 9:39 PM
    my bad
  • a

    agreeable-apartment-19546

    01/28/2023, 11:02 PM
    Is
    htmx:configRequest
    run at every request on the page ? Can I limit it to a specific POST ?
  • g

    green-activity-6102

    01/28/2023, 11:44 PM
    here's kind of a weird one... i have a page with a server-side paginated table that appends
    ?page=N
    to the URL when I change pages i also have buttons in the table which use
    hx-post
    to perform updates in the DB and re-render the table in the response. I want to include the current URL query params in the POST body... Any suggestions? Should I try to use
    beforeRequest
    to append my query params into the POST body?
  • g

    green-activity-6102

    01/28/2023, 11:58 PM
    and on that note... how do i add values to the POST in the beforeRequest handler, seems like this doesn't work
    Copy code
    javascript
    event.detail.requestConfig.parameters[key] = value
  • g

    gentle-salesclerk-37089

    01/29/2023, 12:04 AM
    I did this
  • g

    gentle-salesclerk-37089

    01/29/2023, 12:04 AM
    Copy code
    clojure
          [:div
           [:a (cond->
                 {:data-testid "prev-button"
                  :href (str "/admin/jobs?limit=" limit "&offset=" (max 0 (- offset limit)))
                  :role "button"}
                 (= offset 0) (assoc :disabled "true"))
            "Prev"]
           [:a (cond->
                 {:data-testid "next-button"
                  :href (str "/admin/jobs?limit=" limit "&offset=" (+ offset limit))
                  :role "button"}
                 (< (count jobs) limit) (assoc :disabled "true"))
            "Next"]]])))
  • g

    gentle-salesclerk-37089

    01/29/2023, 12:04 AM
    one option - make an
    a
    tag that has it in the href
  • g

    gentle-salesclerk-37089

    01/29/2023, 12:05 AM
    Copy code
    clojure
          [:button.inline-flex.items-center.justify-center.rounded-md.border.border-transparent.bg-indigo-600.px-4.py-2.text-sm.font-medium.text-white.shadow-sm.hover:bg-indigo-700.focus:outline-none.focus:ring-2.focus:ring-indigo-500.focus:ring-offset-2.sm:w-auto
           {:data-testid (str feature-name "-toggle")
            :hx-post     "/admin/flags/toggle"
            :hx-headers  (cheshire/generate-string
                           {"X-XSRF-Token" anti-forgery-token})
            :hx-vals     (cheshire/generate-string {"feature-name" feature-name})
            :hx-target   "closest tr"
            :hx-swap     "outerHTML"
            :type "button"}
           "Toggle"]]]))
1...99910001001...1146Latest