Hi Maria Jose, just applied a fix. Thanks for notifying about it!
I'll be changing setTimeOut calls for something like requestAnimationFrame at some time. When I develop this code, I had issues for different browsers. Now that we have more browser control, we can do smarter management and maybe left setTimeOut as a fallback for browsers that does not work with better methods. Thanks! :) El mié., 8 ene. 2020 a las 19:32, Maria Jose Esteve (<mjest...@iest.com>) escribió: > Hi, > In the PopUpView.as class, we use popUpVisible property to change his > visibility. > To display his content, we use the "setTimeout" function, which executes > the prepareForPopUp function after 300 milliseconds: > > setTimeout(prepareForPopUp, 300); > > If you show and hide in a short time frame, the prepareForPopUp event > fires after the value of the _popUp variable has been set to NULL causing > exception: > > TypeError: Cannot read property 'addClass' of null > > Would it be correct to verify the _PopUp value before calling it? ... > Something like > > private function prepareForPopUp():void > { > + if (_popUp) > + _popUp.addClass("open"); > > COMPILE::JS > { > //avoid scroll in html > document.body.classList.add("viewport"); > //cancelAnimationFrame(rq); > } > } > > > Thank you, > Hiedra. > -- Carlos Rovira http://about.me/carlosrovira