Hey Dan,
So this is possible but a bit cumbersome right now. Basically when Fancybox looks for links to open, it will check if they have a rel=”gallery” attribute on the link. If so, it will group them together and allow you to navigate between them. This will work for images as well as inline content.
So for links to open modals, you need to add rel=”gallery” TO THE LINK.
The question is how to add that. If you are working in html, it is obviously very easy. It might just look like this:
<a href="#modal1" class="fancybox-inline" rel="gallery">Open Modal 1</a>
<a href="#modal2" class="fancybox-inline" rel="gallery">Open Modal 2</a>
If you are working in the block editor, though, it is is not easy to add an attribute like this to the link. There are plugins like https://www.ads-software.com/plugins/attributes-for-blocks/ that allow you to add attributes to blocks. But if you add a paragraph block, and then convert text to a link, and then use the plugin above to add attributes to the block, the attribute will be added to the p tag, not the a tag, and it needs to be on the a tag.
Obviously you can always find a way in WordPress, and this isn’t rocket science. But it depends on how your adding content.
I should build an easier way to add fancybox classes and attributes to relevant blocks. I’ll add that to my list of feature requests.