nicolas-t/Chocolat

Closing lightbox (from full-screen mode) using Esc throws TypeError

AlexanderFSP opened this issue · 2 comments

Preconditions to reproduce the bug:

  1. Go to http://chocolat.insipi.de/#demo and open console panel in the DevTools
  2. Open lightbox (Full window) and enable full-screen mode
  3. After that use Esc two times (to exit at first from the full-screen mode & to close lightbox after it).

Expected result: Full-screen mode turned off, lightbox closed without any errors.
Actual result: Full-screen mode turned off, but the lightbox still visible. In the console we can observe a TypeError:

Снимок экрана 2020-07-17 в 20 16 16

Thanks, I'll take a look during the weekend.

I released a fix (1.0.3)

Browser seems to be debouncing keypress events when closing the fullscreen mode, so you'll have to wait a few miliseconds between fullscreen closing and lightbox closing.