How to create pop-ups for repeating group elements

I have a repeating group for a list of comments. Each comment I want to be editable, when the user hits the Edit button, a pop-up shows the current comment and allows the user to make changes and then save.

Right now, this is working, I have it constructed such that the Repeating Group references a reusable element titled Comment. Within this reusable Comment element is a pop-up. The workflow within this reusable Comment is that when the Edit button is clicked, the pop-up is filled with the right data from the existing Comment, and then shown to the user.

BUT I realized that this then means that on my actual page there will be as many pop-ups as there are Comments! This seems very inefficient. I should like to just have one pop-up on the page of Comments, and every Edit button click populates the data on that single pop-up.

However, I"m not sure how to do this, since the pop-up on the parent page is not visible to the Edit button click from inside the Comment reusable element.

If you want to access the popup using the Edit button in the repeating group, I think the simplest approach is to place the Edit button directly within the repeating group on the page, rather than inside a reusable element.

That said, I think it’s fine to keep the popup within a reusable element. As I understand it, Bubble doesn’t load the popup onto the page until it’s opened/visible (Performance | Bubble Docs).

Hope that helps.