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

    nice-hairdresser-25140

    11/06/2022, 9:16 PM
    is htmx the right tool to implement a web app that requires drag and drop and serveral interactive behaviours? Lets say its a tool to draw graphs, so i need to draw objects, snap arrows between those objects etc etc
  • n

    nice-hairdresser-25140

    11/06/2022, 9:17 PM
    do you guys think thats the kind of app that may be better with react?
  • r

    ripe-action-67367

    11/06/2022, 10:02 PM
    I will not advocate for any specific library, but yes, this kind of rich client side interactions will require client side scripting, be it vanilla JS, jquery, web components, _hyperscript or The Frameworks. Rich client side interactions are kind of out of scope of htmx, which focuses on the higher level of organization and interactions with the server
  • r

    ripe-action-67367

    11/06/2022, 10:05 PM
    That said, you don't have to write you entire app with one library. Your editor component could be implemented with the library of you choice as isolated module and then embedded in the page or sent as a partial update for htmx request
  • e

    echoing-action-55459

    11/06/2022, 11:19 PM
    Hey every1, Where can I find a list of triggers?
  • m

    mysterious-toddler-20573

    11/06/2022, 11:28 PM
    https://developer.mozilla.org/en-US/docs/Web/Events
  • e

    echoing-action-55459

    11/06/2022, 11:30 PM
    all of the ones under "Element" right? not the "Document" specific ones?
  • e

    echoing-action-55459

    11/06/2022, 11:37 PM
    Also trying to wrap my head around the trigger syntax with filters https://htmx.org/docs/#trigger-filters I see in the docs ctrlKey and shiftKey i see you can even have your own function but does a list of these filters in the system exist or are these two the only ones?
  • g

    gorgeous-airport-54386

    11/06/2022, 11:38 PM
    you can use any JavaScript expression
  • e

    echoing-action-55459

    11/06/2022, 11:38 PM
    Copy code
    ctrlKey
    VM85:1 Uncaught ReferenceError: ctrlKey is not defined
        at <anonymous>:1:1
    (anonymous) @ VM85:1
  • g

    gorgeous-airport-54386

    11/06/2022, 11:38 PM
    Copy code
    html
    <button hx-trigger="click[Math.random() < .95]">
  • e

    echoing-action-55459

    11/06/2022, 11:39 PM
    Yep I got that part but I'm wondering where
    ctrlKey
    comes from
  • g

    gorgeous-airport-54386

    11/06/2022, 11:39 PM
    https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/ctrlKey
  • g

    gorgeous-airport-54386

    11/06/2022, 11:39 PM
    you can access the properties of the event as variables
  • g

    gorgeous-airport-54386

    11/06/2022, 11:40 PM
    it's technically written in the docs but someone was having one of those moments where they forgot not all developers know what name resolution is
  • m

    mysterious-toddler-20573

    11/07/2022, 12:01 AM
    name resolution is just a monoid in the category of endofunctors, what's the problem?
  • e

    echoing-action-55459

    11/07/2022, 12:02 AM
    No problem on my end here's a rough pass of what I was trying to do, create a typescript type for "triggers" https://gist.github.com/reggi/79407c5000963decc6b9e934ee3e2e3d
  • e

    echoing-action-55459

    11/07/2022, 12:03 AM
    theres a bunch of issues for sure but some building blocks for ideally generating the string with some type completion from an object
  • a

    ancient-shoe-86801

    11/07/2022, 12:55 AM
    I just created an account on Mastodon, and hey, found out htmx "exists" there:
  • q

    quick-father-45112

    11/07/2022, 3:16 AM
    Hey folks - I'm getting this error
    SyntaxError: The string did not match the expected pattern.
    from this definition
    hx-target="#1_1_18"
    using an
    hx-confirm
    .
  • q

    quick-father-45112

    11/07/2022, 3:18 AM
    It works as a target for other uses, like swapping out
    innerHTML
    from an
    hx-post
    - but wont work with the
    hx-confirm
    . Anyone know why? Or how I can fix it/work arond it, without changing all of my ID generation logic?
  • m

    mysterious-toddler-20573

    11/07/2022, 3:30 AM
    can you give us the whole stack trace?
  • m

    mysterious-toddler-20573

    11/07/2022, 3:32 AM
    is this in safari?
  • q

    quick-father-45112

    11/07/2022, 3:33 AM
    This is all I get, is that enough? Yes, safari 16.1 on macOS (Ventura), but happens in the previous Safari as well.
  • m

    mysterious-toddler-20573

    11/07/2022, 3:34 AM
    can you set a breakpoint there and see what the string is?
  • m

    mysterious-toddler-20573

    11/07/2022, 3:34 AM
    also, if you could post the HTML in question
  • m

    mysterious-toddler-20573

    11/07/2022, 3:34 AM
    it seems like a bad selector is making it to safari somehow
  • m

    mysterious-toddler-20573

    11/07/2022, 3:34 AM
    also, can you try in another browser and see if it's the same issue?
  • q

    quick-father-45112

    11/07/2022, 3:35 AM
    html is
    Copy code
    <button hx-get="/clear_slot?slot=18" hx-confirm="Are you sure you want to clear this slot?" hx-swap="innerHTML" hx-target="#1_1_18" id="del_1_1_18" class="btn btn-sm btn-outline-danger delete" style="visibility: visible;">X</button>
  • q

    quick-father-45112

    11/07/2022, 3:36 AM
    Hmm, not sure how to set a breakpoint - let me start with trying in Chrome.
1...893894895...1146Latest