-
Hi all - we're just getting started with HTMX for a relatively simple internal portal application. One of our use cases is a button which opens a modal dialog that fetches some additional content to generate a form. We're using Bootstrap 5 for modals styling/js. What we've built so far is essentially some HTML containing the modal with the form when the page renders, and a button which uses bootstrap annotations to show the modal. This works fine, but the contents of that form are expensive to populate, and most of the time, the users aren't opening the modal. I've attempted to use hx-trigger="revealed", but the modal is already "within the viewport" even if it's not visible. My next idea was to use some kind of custom event, and add something like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, this may be off the mark, but the way I generally go about this is not to have any modal on the initial page. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Interesting idea - I suppose the "click outside to close" behavior still just works in this model. I'll give that a go!