minhtranite / react-photoswipe

PhotoSwipe, PhotoSwipeGallery component for ReactJS base on PhotoSwipe.
322 stars 106 forks source link

Render PhotoSwipe in a Portal #17

Open onigoetz opened 7 years ago

onigoetz commented 7 years ago

Is it possible that the PhotoSwipeGallery renders PhotoSwipe in a portal ?

(something like this : https://github.com/tajo/react-portal)

I have the case where my gallery is rendered in an absolute container and it messes up with PhotoSwipe.

oyeanuj commented 7 years ago

@onigoetz Did you end up with a solution for this?

onigoetz commented 7 years ago

Hello, yes, I used a portal on my side, it works perfectly fine.

https://github.com/onigoetz/Comics-Reader/blob/master/src/js/components/ExtendedPhotoSwipeGallery.js

This is how I made it work.