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

    sticky-smartphone-28696

    12/13/2022, 11:25 AM
    but weirdly, I get autocomplete in Console when starting to write htmx. So it is loading?
  • s

    sticky-smartphone-28696

    12/13/2022, 11:32 AM
    ok, got it. It is something with CORS. Finally something to debug! šŸ™‚
  • i

    incalculable-angle-74188

    12/13/2022, 12:01 PM
    Hi, I'm testing htmx for the first time. I'm trying to load a table content from my template (I'm using Symfony+twig):
    Copy code
    twig
    {% extends 'base.html.twig' %}
    {% block title %}Book index{% endblock %}
    {% block body %}
        <h1>Book index</h1>
        <div hx-get={{ path('app_book_index_table') }} hx-trigger="load" hx-target="this">
            Loading...
        </div>
    {% endblock %}
    and it works but only the first time I load the page. If I go to another page and the return to this page a see only the "Loading..." label but the table is not loaded. I see that the GET call is fired and the HTML code received but the content is not swapped. Browser cache problem? Any suggestion?
  • t

    thankful-addition-60522

    12/13/2022, 12:09 PM
    so
  • t

    thankful-addition-60522

    12/13/2022, 12:09 PM
    apparently hx-boost breaks fancybox
  • t

    thankful-addition-60522

    12/13/2022, 12:11 PM
    as in if you write the
    hx-boost
    in a parent container that has a fancybox gallery in it the images will open but when you try to close the image it will become unresponsive
  • t

    thankful-addition-60522

    12/13/2022, 12:12 PM
    that is caused by
    fancybox-container
    not removing itself and getting stuck
  • t

    thankful-addition-60522

    12/13/2022, 12:12 PM
    how to fix that?
  • s

    stocky-dentist-80693

    12/13/2022, 12:19 PM
    https://htmx.org/attributes/hx-disinherit/
  • t

    thankful-addition-60522

    12/13/2022, 12:26 PM
    hmm, doesn't seem to be working
  • t

    thankful-addition-60522

    12/13/2022, 12:26 PM
    placed it both in the gallery container and in the fancybox-container
  • t

    thankful-addition-60522

    12/13/2022, 12:42 PM
    😦
  • t

    thankful-addition-60522

    12/13/2022, 12:44 PM

    https://i.imgur.com/KUYqmSL.pngā–¾

  • t

    thankful-addition-60522

    12/13/2022, 12:45 PM
    what's interesting is it gets stuck in is-closing state
  • i

    incalculable-angle-74188

    12/13/2022, 2:07 PM
    Solved. It was a compatibility issue with Stimulus. I disabled Stimulus and now I can see the table loaded every time
  • s

    stocky-dentist-80693

    12/13/2022, 3:08 PM
    Try
    hx-disinherit="*"
    or
    hx-boost="unset"
    .
  • t

    thankful-addition-60522

    12/13/2022, 3:12 PM
    Tried all, doesn't work as long as there's hx-boost
  • t

    thankful-addition-60522

    12/13/2022, 3:13 PM
    I.e. fancybox-container still sticks
  • t

    thankful-addition-60522

    12/13/2022, 3:14 PM
    I wonder why turbo might not have that problem
  • t

    thankful-addition-60522

    12/13/2022, 5:02 PM
    https://stackoverflow.com/questions/45473522/turbolinks-lightbox-rails-5 https://stackoverflow.com/questions/18105848/jquery-fancybox-doesnt-show-only-after-page-reload
    m
    • 2
    • 51
  • c

    careful-room-54859

    12/13/2022, 10:01 PM
    Question, can
    hx-vals
    contain a nested JSON object?
  • m

    mysterious-toddler-20573

    12/13/2022, 10:07 PM
    I don't believe so unfortunately
  • m

    mysterious-toddler-20573

    12/13/2022, 10:07 PM
    unclear how to encode nested values for the server
  • c

    careful-room-54859

    12/13/2022, 10:10 PM
    I am calling a workflow engine and I need to pass it configuration data e.g.
    workflow name
    , the
    trigger name
    . But I also need to pass it a data object that the workflow works against. I was hoping to do this with pure HTMX but not sure I can do it....
  • c

    careful-room-54859

    12/13/2022, 10:17 PM
    I was able to expose an intermediate endpoint where I capture the metadata from the path parameters and the data from the
    hx-vals
    . Thanks for the clarification.
  • c

    careful-room-54859

    12/13/2022, 10:17 PM
    I then pass this on to the workflow endpoint expecting JSON.....
  • r

    ripe-ghost-5606

    12/14/2022, 12:19 AM
    I'm using HTMX to make a small dashboard for some data visualisation, does it sound like a bad idea to have a bunch of routes responding exclusively with OOB swaps rather than setting targets?
  • w

    wonderful-school-81222

    12/14/2022, 7:23 AM
    Looks like I’m not the only one struggling with deep linking. Found another YouTube video where the person had to have an if statement in their method to check for hx-request and render a partial in that case.

    https://youtu.be/kNXVFB5eQfoā–¾

    l
    g
    • 3
    • 14
  • m

    mammoth-family-48524

    12/14/2022, 11:55 AM
    Sounds fine to me šŸ¤·ā€ā™‚ļø. I’d just go with whatever was easiest to implement and maintain
  • s

    some-airline-73512

    12/14/2022, 3:15 PM
    Is it possible to add additional hx-select-oob from the response header? Similar to HX-Reswap. The use case is: I have a generic table component with fancy checkboxes/filters to search/delete rows. Now when using the table on specific page, I need to update page-specific blocks with hx-select-oob. But generic table html doesn't know about that. I see two possible variations to implement this: a) It would be handy if my server route sent these blocks ids with e.g.
    Hx-Select-Oob=#block
    b) Another way would be in general, if the response html has a top-level element with
    hx-select-oob
    on it, use this to swap. Even if this was not present on the source element. Basically treat response headers as higher priority. @mysterious-toddler-20573 what do you think? Did you have these use cases?
1...947948949...1146Latest