eroself / vaadin-litelement-zxing

ZXing integration on Vaadin 14
MIT License
0 stars 4 forks source link

Disconnected callback being called on init #13

Closed sergiupienar closed 1 year ago

sergiupienar commented 1 year ago

I've added the addon in a Vaadin 14.7.0 app and whenever I'm htting the view that's holding it the disconnected callback method gets called and the app is reloaded.

I added some logging in the vaadin-zxing-reader.js to see what's going on and this is how I got to see that the disconnectedCallback() seems to be getting called every time I go to the view holding the addon.

eroself commented 1 year ago

On app reloading, it removed the previous component which called disconnectedCallback(). Check your code and see if it creates new reader every time when you go to the view.