Also, would this act any differently if you had content in a modal which was the turbo-frame? For example, I have one modal for the page, and N number of elements on the page and when I click on one of those elements it opens the modal and updates its content based on the specific element?
In your example app, for instance, what if clicking on a comment brought up a modal with, say, the comment's author ? (just as a concept)
my eyes started to glaze over on that second paragraph! :). seems much more complex, even though the modal is no more than a hidden div. The need for a specialized stimulus controller, yes, though I was hoping for just throwing an event up (to @ window or @ document) that would be listened for by the frame inside the modal
you've correctly described what worried me. I probably would have hundred of cards from which I want to click to see the modal for more details, but only ever click on a few. So yes, it doesn't make sense to have a 1:1 of card to modal. I'd rather just have one modal, and re-write its content as a card is clicked (based on data from the card, likely just an id for Rails to call -- roughly 'card_modal_path(17)', that sort of thing)
I'm was able to get some code to work that does "many elements calling one modal". No need for a stream. Hung up on using a modal from tailwindui, though