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

    cold-computer-43196

    10/31/2022, 9:55 PM
    Thanks
  • r

    rich-autumn-98740

    10/31/2022, 10:02 PM
    hx-push-url
    doesn't work well with `loading-states`: if I go backwards (push back button) all elements with
    data-loading-disable
    become disabled I assume it's because
    loading-states
    first adds disabled attribute and only then
    hx-push-url
    captures current DOM (together with disabled attribute) what do you suggest to do in this case?
  • r

    ripe-action-67367

    10/31/2022, 10:03 PM
    As a workaround, I suggest to try
    data-loading-delay
    attribute with a tiny value (like 5 or maybe even less)
  • r

    ripe-action-67367

    10/31/2022, 10:04 PM
    this attribute is inherited so you can put it on
    body
  • r

    rich-autumn-98740

    10/31/2022, 10:11 PM
    yeah, works now, thanks. Just have to set delay to ~100ms, otherwise sometimes it's still disabled
  • r

    ripe-action-67367

    10/31/2022, 10:13 PM
    Great!
  • r

    rich-autumn-98740

    10/31/2022, 10:13 PM
    still, I imagine such edge case should be considered as a bug? 🙂
  • f

    freezing-waitress-26396

    10/31/2022, 10:14 PM
    Not that I know of but you can save and restore it like this in a contentEditable, but it makes only sense if the content doesn't change http://jsfiddle.net/6jbwet9q/9/ This works if you sync the contents of a contentEditable with an input. The sync is what I did here https://discord.com/channels/725789699527933952/909436816388669530/1024267243065987123
  • r

    ripe-action-67367

    10/31/2022, 10:16 PM
    Indeed https://github.com/bigskysoftware/htmx/issues/1114
  • r

    rich-autumn-98740

    10/31/2022, 10:17 PM
    cool
  • m

    mysterious-toddler-20573

    10/31/2022, 10:18 PM
    it sounds like the loading-states extension needs to properly clean out the DOM before it is persisted to the history cache
  • m

    mysterious-toddler-20573

    10/31/2022, 10:18 PM
    I'll try to find the dev and let them know
  • m

    mysterious-toddler-20573

    10/31/2022, 10:19 PM
    all the major morphing plugins should keep the caret postion, etc. if you keep the id stable
  • r

    ripe-action-67367

    10/31/2022, 10:26 PM
    The extension should hook into a different event. Currently it performs cleanup on
    htmx:afterOnLoad
    which happens after response is processed (including interactions with history api). Probably, should have used
    htmx:beforeOnLoad
    instead
  • r

    rich-autumn-98740

    10/31/2022, 10:27 PM
    just tested this, yap works
  • r

    ripe-action-67367

    10/31/2022, 10:28 PM
    Did you edit extension source code?
  • r

    ripe-action-67367

    10/31/2022, 10:28 PM
    If so, nice!
  • r

    ripe-action-67367

    10/31/2022, 10:28 PM
    PR welcome, when (and if) you have time
  • r

    rich-autumn-98740

    10/31/2022, 10:29 PM
    yes 🙂
  • r

    rich-autumn-98740

    10/31/2022, 10:29 PM
    changed
    htmx:afterOnLoad
    to
    htmx:beforeOnLoad
    🙂
  • r

    rich-autumn-98740

    10/31/2022, 10:30 PM
    obviously I have no idea if any other problem could happen because of this
  • r

    ripe-action-67367

    10/31/2022, 10:30 PM
    Still, this is great news
  • r

    ripe-action-67367

    10/31/2022, 10:30 PM
    thanks!
  • w

    white-motorcycle-95262

    11/01/2022, 12:49 AM
    Is it possible to use HX-Location and and HX-Push-Url=False together? I'm not sure if my headers are correct or if it's just not supported
  • m

    mysterious-toddler-20573

    11/01/2022, 12:59 AM
    not looking like it: https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L2994
  • g

    green-keyboard-40232

    11/01/2022, 4:10 AM
    Hi. Does anyone have a getting started guide for when working with WordPress? For example, click on a button on Page A to load the content of #my-element on Page B in Page A.
  • r

    ripe-action-67367

    11/01/2022, 6:03 AM
    1. If you want to just load entire pages, use boosting 2. If you want partial updates, use hx-target with hx-select in various proportions
  • p

    prehistoric-wolf-75047

    11/01/2022, 7:02 AM
    This element selects the whole value upon focus via AlpineJS and gets swapped with itself once the backend processed the changed value:
    <input type="text" id="stable" @focus="$event.target.select()" hx-post="" hx-trigger="blur">
    The selection state is not preserved. It only works when this snippet is used: https://github.com/bigskysoftware/htmx/issues/343#issue-796944483
  • r

    ripe-action-67367

    11/01/2022, 7:15 AM
    what swapping extension do you use currently (if any)?
  • p

    prehistoric-wolf-75047

    11/01/2022, 7:49 AM
    I did not specify one specifically. This is on htmx 1.8.2.
1...885886887...1146Latest