maoberlehner / perfundo

a pure CSS lightbox (now with JavaScript).
https://perfundo.oberlehner.net
MIT License
187 stars 9 forks source link

Console errors when .perfundo element doesn't exist #119

Open bradley-varol opened 5 years ago

bradley-varol commented 5 years ago

In my case, the error is as follows:

Uncaught TypeError: element.getAttribute is not a function
    at Object.keys.reduce (main.js:141)
    at Array.reduce (<anonymous>)
    at configure (main.js:140)
    at new Perfundo (main.js:211)
    at ./node_modules/perfundo/js/index.js.__webpack_exports__.default (main.js:124)
    at Module../resources/js/main.js (main.js:830)
    at __webpack_require__ (main.js:20)
    at Object.0 (main.js:864)
    at __webpack_require__ (main.js:20)
    at main.js:84
bradley-varol commented 5 years ago

I've also found that closing the lightbox by clicking the overlay doesn't work if history is enabled.

maoberlehner commented 5 years ago

Hey @bradley-varol! All the things you mention do work fine on the demo page: https://perfundo.oberlehner.net/

It would be very helpful if you provide a reduced test case. You can use https://codesandbox.io/ for example to provide one. Thanks!