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

    dazzling-refrigerator-62542

    08/18/2022, 6:10 PM
    did you set the proper middlewares to handle urlendcoded forms?
  • d

    dazzling-refrigerator-62542

    08/18/2022, 6:10 PM
    Copy code
    app.use(express.urlencoded({
      extended: true
    }))
    Once set, you can read the body via
    req.body
  • e

    eager-planet-96345

    08/18/2022, 6:36 PM
    yes
  • e

    eager-planet-96345

    08/18/2022, 6:36 PM
    thank you
  • m

    mysterious-toddler-20573

    08/18/2022, 8:31 PM
    https://twitter.com/slightlylate/status/1560338842774675458
  • m

    mysterious-toddler-20573

    08/18/2022, 8:31 PM
    absolutely seething that I didn't tweet this first
  • m

    mysterious-toddler-20573

    08/18/2022, 8:32 PM
    just furious
  • d

    dazzling-refrigerator-62542

    08/18/2022, 8:32 PM
    I'm in utter disbelief
  • s

    silly-bear-76516

    08/18/2022, 9:01 PM
    I think my htmx frens will relate to this here talk:

    https://www.youtube.com/watch?v=rvoZKQn2Go8▾

  • b

    bland-football-18851

    08/18/2022, 9:36 PM
    Hi, how can I add custom headers (say, NTLM stuff) to an hx-post or hx-get?
  • m

    mysterious-toddler-20573

    08/18/2022, 10:46 PM
    hx-headers attribute or the htmx:configRequest event
  • l

    loud-action-20310

    08/19/2022, 8:32 PM
    hello, working on the "load more" infinite scroll style pagination in one of my rails projects.
    Copy code
    <div id="pagination" hx-boost="true" hx-target="#posts" hx-swap="beforeend" hx-swap-oob="true" class="mt-10 flex flex-col items-center space-y-3">
      <div class="text-sm text-gray-500"><%= page_entries_info @posts, entry_name: "post" %></div>
      <%= paginate @posts %>
    </div>
  • l

    loud-action-20310

    08/19/2022, 8:32 PM
    everything works great. new posts are inserted at the end of #posts and #pagination is replaced with new load more link
  • l

    loud-action-20310

    08/19/2022, 8:33 PM
    except the page scrolled to the bottom after each swap and I obviously don't want that
  • l

    loud-action-20310

    08/19/2022, 8:34 PM
    is there any way to prevent this? as you can see I didn't set scroll in the
    hx-swap
  • m

    mysterious-toddler-20573

    08/19/2022, 8:56 PM
    hmm
  • m

    mysterious-toddler-20573

    08/19/2022, 8:56 PM
    default should be not to scroll
  • m

    mysterious-toddler-20573

    08/19/2022, 8:56 PM
    do you have any other configuration tweaks or parent elements w/ hx-swap on them?
  • l

    loud-action-20310

    08/19/2022, 9:09 PM
    nope.. I also checked pagination href links and there are no anchors 🤔
  • m

    mysterious-toddler-20573

    08/19/2022, 9:11 PM
    you don't see this behavior here, correct: https://htmx.org/examples/click-to-load/
  • m

    mysterious-toddler-20573

    08/19/2022, 9:14 PM
    it may also be due to an autofocus
  • l

    loud-action-20310

    08/19/2022, 9:14 PM
    nope, that example works as I'd expect it to
  • l

    loud-action-20310

    08/19/2022, 9:15 PM
    I also have sticky side nav menu but I get scrolling even if I remove it
  • m

    mysterious-toddler-20573

    08/19/2022, 9:15 PM
    any autofocus attributes?
  • l

    loud-action-20310

    08/19/2022, 9:16 PM
    nope, no forms here
  • m

    mysterious-toddler-20573

    08/19/2022, 9:16 PM
    if you can run against the unminified source, the function is here:
  • m

    mysterious-toddler-20573

    08/19/2022, 9:16 PM
    https://github.com/bigskysoftware/htmx/blob/1aafebb0dae2b645c9a03469b1d2e1a71c1f5200/src/htmx.js#L2366
  • m

    mysterious-toddler-20573

    08/19/2022, 9:16 PM
    or just download it
  • m

    mysterious-toddler-20573

    08/19/2022, 9:16 PM
    and set a break point
  • l

    loud-action-20310

    08/19/2022, 9:18 PM
    I changed the code to work without out of band swapping:
    <div id="more" hx-boost="true" hx-target="#more" hx-swap="outerHTML">
1...784785786...1146Latest