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

    tall-dinner-62086

    12/22/2022, 1:03 AM
    I think
  • h

    hundreds-camera-24900

    12/22/2022, 1:03 AM
    yea that would be ideal
  • h

    hundreds-camera-24900

    12/22/2022, 1:13 AM
    hx-trigger=" keyup  from:#search_form input, search, submit"
    works
  • h

    hundreds-camera-24900

    12/22/2022, 1:14 AM
    but interestingly the
    changed
    modifier breaks it
  • h

    hundreds-camera-24900

    12/22/2022, 1:14 AM
    I'm thinking that might check the changing value on the element receiving the event and not the one triggering it
  • h

    hundreds-camera-24900

    12/22/2022, 1:21 AM
    huh actually no, that drops a syntax error in the console
  • h

    hundreds-camera-24900

    12/22/2022, 1:21 AM
    although it does work
  • h

    hundreds-camera-24900

    12/22/2022, 1:22 AM
    Child selectors don't work here
  • h

    hundreds-camera-24900

    12/22/2022, 1:26 AM
    yeah I wonder if this is a bug - hx-trigger + from + "changed" never fires
  • h

    hundreds-camera-24900

    12/22/2022, 1:35 AM
    also for the original question - the event does bubble, and
    hx-trigger="input delay:500ms, search, submit"
    will catch all child inputs
  • h

    hundreds-camera-24900

    12/22/2022, 1:35 AM
    any reason to use keyup instead of input?
  • m

    mysterious-toddler-20573

    12/22/2022, 2:57 AM
    keyup should bubble
  • m

    mysterious-toddler-20573

    12/22/2022, 2:57 AM
    yeah, it's the
    changed
    modifier: it is checking the
    value
    of the form, which is always null
  • m

    mysterious-toddler-20573

    12/22/2022, 2:58 AM
    we should at least have an option to make that the value of the event target
  • j

    jolly-motorcycle-88169

    12/22/2022, 5:10 AM
    hey i got around to trying this and it didnt seem to work. I think its because it is in a
    hx-vals="js:"
    tag so even if it ends up being
    hx-vals="js: unset"
    in the end it still tries to send it as it wasnt unset at the start. Am i doing something wrong?
  • r

    ripe-action-67367

    12/22/2022, 6:46 AM
    Just use hx-vals="unset"
  • c

    creamy-yak-21324

    12/22/2022, 7:38 AM
    Hello, using hx-boots on links that load new data, it works great but always scroll to new loaded data
  • c

    creamy-yak-21324

    12/22/2022, 7:39 AM
    are there some possibility to disable this behaviour ? Or just I missing something ?
  • s

    some-airline-73512

    12/22/2022, 9:29 AM
    I mean rust/c/zig implementation of renderer
  • b

    blue-ghost-19146

    12/22/2022, 5:14 PM
    Yep this should work if using the most recent version of htmx
  • b

    blue-ghost-19146

    12/22/2022, 5:15 PM
    Before that, hx-vals=“unset” didn’t work iirc
  • s

    stocky-school-57923

    12/22/2022, 5:53 PM
    I'm having trouble replicating the delete row example (https://htmx.org/examples/delete-row/). The hx-delete request is sent and works fine, but the row is not removed from the table. I've tried returning both a 204, and no response at all. Anyone have any idea what i am doing wrong? Code below:
  • s

    stocky-school-57923

    12/22/2022, 5:53 PM
    Copy code
    <button type="button" class="flex items-center text-red-300 hover:text-red-600 focus:outline-none"
    hx-trigger="click"
    hx-delete="{{url_for('main.show_own_products_edit_row', product_id = product.id)}}"
    hx-target="closest tr" 
    hx-swap="outerHTML swap:1s"
    hx-confirm="Are you sure?" >
  • s

    sparse-musician-64201

    12/22/2022, 5:55 PM
    i dont thik you need the hx-trigger or hx-swap attribute for it to work,
  • s

    sparse-musician-64201

    12/22/2022, 5:56 PM
    the problem is more likely that your framework returns 204 status code and htmx read this as 'no work to do'
  • s

    sparse-musician-64201

    12/22/2022, 5:56 PM
    change it to an empty 200 response and it will work
  • s

    stocky-school-57923

    12/22/2022, 6:00 PM
    Perfect, thanks. The 200 worked! The hx-trigger is probably not neccecary, but works anyway.
  • a

    ancient-shoe-86801

    12/22/2022, 6:28 PM
    just built a table with column sorting on click and infinite scrolling, all with only htmx, and it's so beautiful
  • w

    worried-hair-75253

    12/22/2022, 6:37 PM
    curious @ancient-shoe-86801 , when sorting by column, are you getting a whole new set of table rows from the server to replace all existing data?
  • a

    ancient-shoe-86801

    12/22/2022, 6:39 PM
    on this case, when the user clicks on the header of one column, it will fetch a new table (header + rows) and replace the current one. I am doing that because the header changes to show what column you are sorting on.
1...957958959...1146Latest