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

    mysterious-toddler-20573

    07/23/2020, 6:58 PM
    ironically the problem is that javascript isn't expressive enough for things like DOM manipulation
  • m

    mysterious-toddler-20573

    07/23/2020, 6:58 PM
    hyperscript is going to try to fix that
  • m

    mysterious-toddler-20573

    07/23/2020, 6:58 PM
    we'll see
  • b

    big-airline-13935

    07/23/2020, 7:36 PM
    Sounds ambitious, I like it!
  • c

    clean-insurance-87312

    07/24/2020, 8:13 AM
    Hello, I just stumbled upon htmx a few minutes ago and am wondering if it can help me with the following. I have two forms that I want to submit with the same button click. I.e., I click on a submit button and the data from both form1 and form2 gets submitted. Is this possible with htmx? If so, how would I do it? Thanks.
  • b

    big-airline-13935

    07/24/2020, 11:59 AM
    @clean-insurance-87312 sounds like you’re making life hard for yourself, why not just use a single form?
  • t

    thankful-monkey-57044

    07/26/2020, 3:33 PM
    Hello all. I potentially have an edge case issue with htmx, one I spent the better part of a week on and off trying to debug before realizing htmx was even involved. Seems like under certain conditions my layout is broken in Safari by inclusion of
    .../htmx.org@0.0.8
    . be it from a CDN or just inlining the whole script. At first I thought it was only breaking layouts where I was including a link to htmx without any htmx calls in the page, but it seems like even layouts that are making use of htmx are affected.
  • t

    thankful-monkey-57044

    07/26/2020, 3:34 PM
    I sent a lot of time assuming tailwind was the culprit, hence my posts here... https://discordapp.com/channels/486935104384532500/486935104384532502/736317014586687689
  • t

    thankful-monkey-57044

    07/26/2020, 3:34 PM
    and here: https://discordapp.com/channels/486935104384532500/486935104384532502/736945058233843732
  • t

    thankful-monkey-57044

    07/26/2020, 3:36 PM
    Anyway... just wondering if anyone has run into anything similar, and could suggest a workaround/fix, or even a good explanation as to why the issue is completely avoided when the cache is disabled.
  • b

    breezy-horse-84370

    07/26/2020, 7:28 PM
    Could you try moving the script tag to the end of body? Seems to solve the issues for me...
  • b

    breezy-horse-84370

    07/26/2020, 7:31 PM
    Probably due to DOMContentLoaded behaving slightly differently in Safari? 🤷‍♂️
  • t

    thankful-monkey-57044

    07/26/2020, 7:51 PM
    @User Thanks – but I've moved it to every conceivable place and still get the same result. Very strange!
  • c

    clean-insurance-87312

    07/26/2020, 7:51 PM
    @User Thanks, I ended up rewriting my html so that I could put everything in one form.
  • t

    thankful-monkey-57044

    07/26/2020, 7:54 PM
    @User Here is a video of the problem in action – a broken layout, but fixed when I either resize the window to the next breakpoint, or reload the page with caching disabled. This is why it took me so long to debug, I didn't see how a script issue would be fixed by resizing to the next breakpoint.
  • t

    thankful-monkey-57044

    07/26/2020, 7:56 PM
    I have disabled every other item of JavaScript on the page in every possible permutation ...nothing fixes it, but removing the call to htmx does immediately and durably.

    https://youtu.be/qrDj-pf1X7A▾

  • t

    thankful-monkey-57044

    07/26/2020, 7:57 PM
    What you see in this clip is the layout as it looks when htmx is included. Removing it fixes it. Reloading with cache disabled (which I also demo) also fixes it.
  • t

    thankful-monkey-57044

    07/26/2020, 7:58 PM
    Again, only seeing this in Safari.
  • b

    big-airline-13935

    07/26/2020, 7:59 PM
    I have no ideas, but perhaps a Github issue with some code samples would be better suited to getting help with this.
  • b

    big-airline-13935

    07/26/2020, 7:59 PM
    Or even better would be a codepen.
  • t

    thankful-monkey-57044

    07/26/2020, 9:33 PM
    @User I agree that would be ideal, but not possible I'm afraid. It's a very edge case. That it doesn't happen in all layouts, never happens on the first load, and never happens on loads with cache disabled...all goes to show what an edge case this is. I have no idea how to begin replicating it unfortunately. I can provide anyone who wants it access to the staging server where they can maybe experience it themselves, but not yeah...not ideal I know.
  • l

    lively-beach-14291

    07/26/2020, 10:15 PM
    I'm enchanted with HTMX, it seems like a perfect tool for a server-side developer who wants to keep their front/back end code in the same place and not have to twibble with JSON based APIs.
  • m

    mysterious-toddler-20573

    07/27/2020, 12:39 AM
    @User can you inspect the elements and see why they are styled improperly? Only thing I can think is maybe the dynamically injected CSS from htmx occasionally screws up layout
  • m

    mysterious-toddler-20573

    07/27/2020, 12:40 AM
    @User I had to learn a lot about javascript so I could avoid writing javascript 😉
  • m

    mysterious-toddler-20573

    07/27/2020, 12:44 AM
    @User If you inspect the DOM in firefox or Chrome it should show you why the box is being laid out the way it is, and that would point to cuprit. If you post a screen shot I can take a look.
  • t

    thankful-monkey-57044

    07/27/2020, 6:54 AM
    > @thankful-monkey-57044 If you inspect the DOM in firefox or Chrome it should show you why the box is being laid out the way it is, and that would point to cuprit. If you post a screen shot I can take a look. @mysterious-toddler-20573 thanks. I made a video, link is in my previous post. Issue is Safari only and at times difficult to replicate.
  • t

    thankful-monkey-57044

    07/27/2020, 6:55 AM
    I have compared source and inspected the failed layout and there is no difference. Also, resizing the browser to the next breakpoint fixes it, further indicating a paint or render bug of some kind. No idea ...only know that disabling the cache fixes it and removing the link to htmx fixes it. 🤔
  • t

    thankful-monkey-57044

    07/27/2020, 6:56 AM

    https://youtu.be/qrDj-pf1X7A▾

  • b

    big-airline-13935

    07/27/2020, 7:22 AM
    @User This could of course just be a bug in Safari...
  • t

    tall-dinner-62086

    07/27/2020, 10:18 AM
    I've been trying to come up with a way to make an auto-complete text field using htmx, but haven't found one that isn't extremely convoluted. Guess I'll have to sprinkle some hyperscript in there.
1...111213...1146Latest