fancyapps / ui

A library of JavaScript UI components, includes the best lightbox - Fancybox5
https://fancyapps.com/
Other
819 stars 98 forks source link

on Nextjs (^14.1.3) when click image, the image gallery show but suddenly close #634

Closed alvinChristianto closed 8 months ago

alvinChristianto commented 8 months ago

Describe the bug

I update the next js from nextjs13 to nextjs 14, I checked the function of my website and got something strange in the fancybox galleries (multiple image). When I click one image, it enlarge, but suddenly close.

here is the video sample

https://github.com/fancyapps/ui/assets/39409708/cc82c332-c224-441d-90a3-e13ee3e35a02

Reproduction

  1. run the local server npm run dev
  2. check page that have multiple images
  3. click image
  4. popup image enlarge, but suddenly close.
  5. no error in console

Additional context

i use "@fancyapps/ui": "^5.0.24" "next": "^14.1.3"

, in package.json

fancyapps commented 8 months ago

Hi,

It depends on how you integrate Fancybox into React and how you use it.

I am quite sure that your component is re-rendering and that is triggering closing of the Fancybox. Since I can not see or debug your code, I will not be able to give you a more precise answer.