I’m using the Gallery field in a frontend form. Works great. Except that, despite having selected “uploaded to post” for the library, it still gives access to the full media library. Is this an issue with the frontend form function? When I had it as a single image to upload the library restriction worked fine. But it doesn’t seem to want to for the gallery.
I’ve just tested it on my end but failed to reproduce it. Could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.
If the issue persists, could you please share the JSON export file of your field group so I can test it out on my end?
I recently observed the same problem when I was using acf_form() with the 'post_id' => 'new_post' setting.
For me, the solution was to first create an 'auto-draft' post and then run the acf_form() on this posts’s ID: