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

    ancient-shoe-86801

    10/05/2022, 7:51 PM
    I'm talking about htmx on a Discord about a tabletop miniatures wargame
  • a

    ancient-shoe-86801

    10/05/2022, 7:51 PM
    if that's not evangelizing... 😅
  • m

    mysterious-toddler-20573

    10/05/2022, 9:06 PM
    https://twitter.com/slightlylate/status/1577746683600941056
  • p

    proud-librarian-99598

    10/06/2022, 6:47 AM
    It is unclear to me from the docs how multiple config settings can be done. Can this work:
    Copy code
    <meta name="htmx-config" content='{"useTemplateFragments": true}'>
        <meta name="htmx-config" content='{"includeIndicatorStyles": false}'>
    Or do you need to use a single
    htmx-config
    meta tag with all options together?
  • t

    tall-dinner-62086

    10/06/2022, 8:16 AM
    I know having multiple options in one tag works. I would not expect multiple tags to work, but should be easy enough to test
  • l

    late-king-98305

    10/06/2022, 12:33 PM
    I hate it when I forget to assign my objects... uh... 332 times. Thanks, build tools!
  • g

    green-activity-6102

    10/07/2022, 12:24 AM
    im really struggling with nesting htmx-driven elements -- when i click on the nested element it seems to trigger BOTH the immediate node's listener AND the inherited ones from parents.
    hx-disinherit="*"
    seems to have no effect... what am i missing?
  • g

    green-activity-6102

    10/07/2022, 12:24 AM
    essentially ive got a table where every
    <tr>
    has
    hx-get
    on it, but also one of
    <td>
    cells in every row has special click behavior that i'd like to override with a different
    hx-get
  • g

    green-activity-6102

    10/07/2022, 12:50 AM
    i've tried putting
    hx-disinherit="*"
    on both the parent (docs seem to indicate it belongs here) and the child -- neither works
  • m

    mysterious-toddler-20573

    10/07/2022, 1:14 AM
    problem is event bubbling
  • m

    mysterious-toddler-20573

    10/07/2022, 1:15 AM
    the click event is bubbling up to the row, etc
  • m

    mysterious-toddler-20573

    10/07/2022, 1:15 AM
    🤔
  • m

    mysterious-toddler-20573

    10/07/2022, 1:15 AM
    we should probably have a modifier for
    hx-trigger
    that lets you halt event bubbling
  • m

    mysterious-toddler-20573

    10/07/2022, 1:16 AM
    https://htmx.org/attributes/hx-trigger/
  • m

    mysterious-toddler-20573

    10/07/2022, 1:16 AM
    and it looks like we do:
    consume
  • m

    mysterious-toddler-20573

    10/07/2022, 1:16 AM
    so put
    hx-trigger="click consume"
    on the child elements
  • g

    green-activity-6102

    10/07/2022, 1:26 AM
    whoaaaaaaaaaaa
  • g

    green-activity-6102

    10/07/2022, 1:26 AM
    let me try this!
  • g

    green-activity-6102

    10/07/2022, 1:29 AM
    IT FRIGGIN WORKS
  • g

    green-activity-6102

    10/07/2022, 1:29 AM
    thanks Carson 👍
  • m

    mysterious-toddler-20573

    10/07/2022, 1:37 AM
    https://tenor.com/view/bongos-cat-dancing-vibe-edited-gif-19250605
  • a

    ancient-shoe-86801

    10/07/2022, 3:16 AM
    something is wrong with the css:
  • m

    most-flag-2080

    10/07/2022, 6:27 AM
    Hotwire is the future
  • f

    freezing-waitress-26396

    10/07/2022, 8:25 AM
    consume
    is a good thing yes
  • b

    blue-ghost-19146

    10/07/2022, 10:58 AM
    Hi all, I've come across an issue where
    "quoted"
    values within
    hx-vals
    cause a SyntaxError (
    htmx.min.js:1 SyntaxError: Expected ',' or '}' after property value in JSON at position 126
    ). e.g.
    hx-vals='{"key": ""val""}'
    where
    "val"
    is user input. Using Django's
    |escapejs
    filter will escape the quotes appropriately:
    hx-vals='{"key": "\u0022val\u0022"}'
    . This causes the request to work as expected. My question is: Is escaping the characters like this the correct approach, or am I missing something?
  • h

    happy-pillow-29003

    10/07/2022, 1:16 PM
    Hello, I’m trying to do something similar to https://htmx.org/examples/value-select/ except each field is a list of checkboxes (each having the same name). Adding
    hx-get="..."
    to each checkbox results in multiple requests being sent to the server every time I check or uncheck a box, with only the value of the selected element. I’ve tried adding
    hx-include="input[name='foobar']"
    which seems to add the other checkboxes values to the request, but it still sends multiple requests
  • e

    echoing-dress-67727

    10/07/2022, 1:23 PM
    Does anyone know why I'm getting an extra
    POST
    request when I've got
    <form hx-patch="/whatever" action="#" method="post">
    ? The
    action
    and
    method
    get added by Rails, so I'm not sure if I can remove them. But I'm fairly certain this line should be preventing the
    POST
    anyways https://github.com/bigskysoftware/htmx/blob/3c6b5996a147aa14da52f04c3b233a4778918181/src/htmx.js#L1302
  • m

    mysterious-toddler-20573

    10/07/2022, 1:37 PM
    is it possible that turbolinks or hotwire is also loaded in rails and is issuing the request? Can you take a look at the network tab in the console and see where the request is coming from?
  • m

    mysterious-toddler-20573

    10/07/2022, 1:38 PM
    yep, you are going to need to escape that unfortunately. I wish JSON were more flexible. If you want to switch to JavaScript object notation, you can prefix it with
    js:
  • m

    mysterious-toddler-20573

    10/07/2022, 1:38 PM
    but that will require eval to work
1...845846847...1146Latest