nicolas-t / Chocolat

Chocolat : the lightbox so cool horses use it :horse:
http://chocolat.insipi.de
GNU General Public License v3.0
1.69k stars 169 forks source link

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

Closed AlexanderFSP closed 4 years ago

AlexanderFSP commented 4 years ago

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
nicolas-t commented 4 years ago

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

nicolas-t commented 4 years ago

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.