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

    glamorous-beach-89957

    08/17/2020, 8:17 PM
    it is interesting indeed, but not sure if it would help selling the htmx for an existing project...
  • b

    big-airline-13935

    08/17/2020, 8:18 PM
    In that case check out https://github.com/alpinejs/alpine @User
  • m

    mysterious-toddler-20573

    08/17/2020, 11:41 PM
    @User is https://github.com/bigskysoftware/htmx/pull/166/files a fix? Or demonstrating an issue?
  • m

    mysterious-toddler-20573

    08/17/2020, 11:42 PM
    I have the trigger on line 1602
  • b

    big-airline-13935

    08/17/2020, 11:44 PM
    The PR adds the tests to simply confirm whether the events are being triggered, which in my local tests they are not.
  • m

    mysterious-toddler-20573

    08/17/2020, 11:45 PM
    :/
  • m

    mysterious-toddler-20573

    08/17/2020, 11:45 PM
    but the code
  • b

    big-airline-13935

    08/17/2020, 11:45 PM
    I see the events being triggered in the code... but the tests...
  • m

    mysterious-toddler-20573

    08/17/2020, 11:45 PM
    gestures vaguely towards the code
  • b

    big-airline-13935

    08/17/2020, 11:45 PM
    (and it could be my human error, hence the automated tests)
  • m

    mysterious-toddler-20573

    08/17/2020, 11:45 PM
    I don't have a proper desk yet, but I'll fix this immediately once I do
  • b

    big-airline-13935

    08/17/2020, 11:46 PM
    I'm not claiming that anything is broken, only that it is untested 😉
  • p

    powerful-evening-99811

    08/17/2020, 11:52 PM
    any thoughts on the SSE design iteration that's been going on?
  • m

    mysterious-toddler-20573

    08/18/2020, 12:04 AM
    I like it, but I'm so underwater
  • m

    mysterious-toddler-20573

    08/18/2020, 12:04 AM
    and I don't have a proper desk to work at
  • m

    mysterious-toddler-20573

    08/18/2020, 12:05 AM
    so I'm typing on a scissor-key lappy with a screen my eyes can barely deal with
  • m

    mysterious-toddler-20573

    08/18/2020, 12:05 AM
    I need a real keyboard and monitor before I can have a competent technical opinion on anything
  • p

    powerful-evening-99811

    08/18/2020, 12:12 AM
    anything i can clean up/work on/create demo that would be productive?
  • m

    mysterious-toddler-20573

    08/18/2020, 12:44 AM
    I was going to knock out a demo on images that start with a spinner source and then load a new image on reveal
  • t

    tall-dinner-62086

    08/18/2020, 10:36 AM
    Alright I think I'm stumped. I need to partition a request into smaller requests and I can't figure out how to make htmx work for me here. Use case is copy/pasting data from an excel sheet, to be formatted on the server which returns html table rows. Works fine for small requests, but if I try to copy a large sheet I run into memory issues on the server, so I need to be able to partition the request on the client side.
  • t

    tall-dinner-62086

    08/18/2020, 10:41 AM
    This is what I have right now, which listens to a paste event and uploads the data. I've tried partitioning in javascript and trying to emit multiple "pasted" events, but that doesn't work at all. Think I need to just not use htmx for this and manually do the requests and handle the responses
    Copy code
    <form>
          @csrf
          @method('PUT')
          <input id="paste_area" type="hidden" name="paste" value="" hx-trigger="pasted" hx-target="#articles tbody" hx-post="{{route('budgets.paste', $budget->id)}}" hx-swap="beforeend">
        </form>
    
    
    <script type="text/javascript">
      document.addEventListener('paste', function(e) {
        if e.srcElement.tagName == 'INPUT') return;
        document.getElementById('paste_area').value = JSON.stringify(handlePaste(e));
        let evt = new Event('pasted');
        document.getElementById('paste_area').dispatchEvent(evt);
      });
    </script>
  • m

    mysterious-toddler-20573

    08/18/2020, 1:01 PM
    Yeah, that might be a situation where htmx isn't gonna help much
  • m

    mysterious-toddler-20573

    08/18/2020, 1:01 PM
    sorry about that
  • q

    quick-bear-11854

    08/20/2020, 10:42 AM
    hi, does "hx-get" support running the tags inside the returned HTML? There was a message in the gitter on "Jun 04 01:06" about it being fixed in dev, but it doesn't appear to work in 0.0.8
  • q

    quick-bear-11854

    08/20/2020, 12:04 PM
    Ah it does seem to be getting executed OK, just a variable scoping issue. Thanks for the great project!
  • m

    mysterious-toddler-20573

    08/20/2020, 8:11 PM
    👍
  • s

    stale-whale-50398

    08/22/2020, 6:18 PM
    Hello everyone recently discovered Htmx which is awesome by the way, came across an issue though that I'm hoping someone might have some more insight on. I've got a data-tables table of users and in each row consisting of a user I have a column of html rendered for a font-awesome button that looks like a toggle switch wrapped in and link anchor to issue a get request which would then ban the user then reload the page so I wanted to use Htmx to bypass the whole redirect and just replace the toggle with it's opposite (on/off). However when replacing the anchor link with a div and adding hx-get nothing happens, presumably the way the page is loading it's not connecting to that hx-get tag. Adding something outside of the data-tables row rendering works as expected so it's setup right. Anyone have any ideas?
  • p

    powerful-evening-99811

    08/22/2020, 11:27 PM
    got a gist?
  • s

    stale-whale-50398

    08/23/2020, 12:06 AM
    I'm not sure it would help being able to see the whole picture is drawn out over a lot of different files but I'll try and copy the relevant bits, the main issue is that it creates dynamic content (html) and the event listeners don't attach to them. I had a similar issue tonight where I was jquery's
    .each()
    with
    (this).keyup()
    and when htmx would replace the html of the elements with in there they'd lose their event listener so I swapped to
    (document).on("keyup", "#element", ...)
    which still works since it's attached to the document instead of the element.
  • s

    stale-whale-50398

    08/23/2020, 12:18 AM
    https://gist.github.com/extant1/bc8c7f20cb71ab5b663726ebb42ab255
1...161718...1146Latest