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

    miniature-lizard-24702

    11/15/2022, 4:12 PM
    design driven design is complementary to modular monoliths as well.
  • m

    miniature-lizard-24702

    11/15/2022, 4:17 PM
    I see it loosely like a set of microservices packaged as a monolith (but not quite)
  • s

    salmon-oil-67352

    11/15/2022, 4:17 PM
    Works like a charm, thanks
  • w

    white-london-59674

    11/15/2022, 4:33 PM
    Cohost does indeed have some HTML support — perhaps it's just markdown? They sanitize it to some extent (e.g. iframe didn't work). I know this has security and trust issues, but before getting there, I'm just trying to put the fundamental concept out there and see interest. There are also some interesting architecture considerations, which tie into security and trust (e.g. a p2p network, which shows you more content from people you follow+know, could have different trust implications than a more centralized service.)
  • b

    billions-furniture-78242

    11/15/2022, 6:53 PM
    I am not sure if it is the right forum to ask, but, is it possible to create themes(dark/light or any custom made) using Thymeleaf and htmx ? Is it possible to use SCSS too ?
  • w

    worried-eve-2556

    11/15/2022, 6:54 PM
    depends on the amount of work I guess - if it's not lots of extra work then it is quite fun to say "these silly web frameworks don't even support all the browsers but HTMX does!"
  • g

    gorgeous-airport-54386

    11/15/2022, 6:58 PM
    what would be the breaking changes?
  • m

    mysterious-toddler-20573

    11/15/2022, 7:01 PM
    the big ones would be: - going template-parsing-by-default would be out (to eliminate table jank) - no modern closure syntax (I don't really care) - a few annoying if statements (I don't really care) - I need to look at idiomorph, if that gets into the core of htmx it will need to be at least non-IE breaking
  • g

    gorgeous-airport-54386

    11/15/2022, 7:06 PM
    no i meant what breaking changes are in 2.0 other than no ie
  • m

    mysterious-toddler-20573

    11/15/2022, 7:20 PM
    mmm
  • m

    mysterious-toddler-20573

    11/15/2022, 7:20 PM
    not many
  • m

    mysterious-toddler-20573

    11/15/2022, 7:20 PM
    I would like to go template-parsing by default
  • m

    mysterious-toddler-20573

    11/15/2022, 7:20 PM
    web sockets and sse are pulled out to extensions only
  • g

    gorgeous-airport-54386

    11/15/2022, 7:20 PM
    do it then :|
  • m

    mysterious-toddler-20573

    11/15/2022, 7:20 PM
    that's really the big break
  • g

    gorgeous-airport-54386

    11/15/2022, 7:21 PM
    -> that you can think of
  • m

    mysterious-toddler-20573

    11/15/2022, 7:21 PM
    -> right now
  • m

    mysterious-toddler-20573

    11/15/2022, 7:21 PM
    -> I can't remember what I had for breakfast
  • g

    gorgeous-airport-54386

    11/15/2022, 7:21 PM
    imagine what you could do in 2.1!
  • m

    mysterious-toddler-20573

    11/15/2022, 7:21 PM
    if we change inheritance semantics that's obviously big
  • m

    mysterious-toddler-20573

    11/15/2022, 7:21 PM
    but I don't think we will
  • w

    white-motorcycle-95262

    11/15/2022, 8:20 PM
    I have a shopping cart sidebar thing (slides out when you click the cart icon) that has an
    input
    field for a coupon/promotion code. That field has an
    hx-put
    that targets the entire shopping cart (backend verifies if the coupon exists/is applicable and re-renders the cart if so, or renders an error around the input). The trigger is
    hx-trigger="keyup changed delay:500ms"
    The issue is: if someone takes more than 500ms (or whatever the delay value is set to), then the input gets unfocused when the response loads. Even if I add a
    autofocus
    attribute to the input in the response, it stays focused but the cursor moves to the start of the input field. What's the best way to address this in a way that gives the optimal user experience?
  • s

    salmon-oil-67352

    11/15/2022, 8:22 PM
    I'm using HTMX with Bootstrap. I have a form that is inside a bootstrap modal: "". After submitting the form the page changes correctly, but the modal does not hide/go away. Does anybody have an idea how to fix this? I thought about doing: htmx.on('htmx:beforeSwap', (event) => { $("#generic_modal_placeholder").modal('hide'); } ) But the problem is I use HTMX to render the modal, so this approach does not work.
  • w

    white-motorcycle-95262

    11/15/2022, 8:24 PM
    Do you mean the modal is still there, or the dark background is still there? I've had to deal with both issues before
  • s

    salmon-oil-67352

    11/15/2022, 8:25 PM
    Nice catch, only the dark background is still there
  • w

    white-motorcycle-95262

    11/15/2022, 8:28 PM
    I ended up using hyperscript on the fragment that is put into the modal:
    Copy code
    on click from <a/> in me
      transition .modal-backdrop's opacity to 0
      remove (.modal-backdrop)
    end
    I'm sure you can do something similar in vanilla js if not using hyperscript. EDIT: The important part was haivng that on the fragment that htmx put into the modal. I have a modal defined in my base.html template that has no contents, and I tell htmx to put request into it. So if I definded that on the modal, it wouldn't know of any tags.. Obviously you'll need to adapt it a little bit. My concern was links in the modal didn't remove the dark background.
  • s

    salmon-oil-67352

    11/15/2022, 8:29 PM
    Ok thanks for that, i'll have a look, not sure how to help with your issue.
  • m

    mysterious-toddler-20573

    11/15/2022, 8:29 PM
    it sounds like you might want to try a morph swap
  • m

    mysterious-toddler-20573

    11/15/2022, 8:29 PM
    replacing the currently active input is pretty tricky without doing something like that.
  • m

    mysterious-toddler-20573

    11/15/2022, 8:30 PM
    let me see if hx-preserve works in a demo, that would be the absolute easiest
1...907908909...1146Latest