Closed LIT-EIA-OWNER closed 2 years ago
this code was to change focus on error - prolly for WSCOE
comment out the following
//Only trigger if instructions exist and not empty if (instrfocus.length > 0 && !(instrfocus.html() == "")) { $([document.documentElement, document.body]).animate({ scrollTop: instrfocus.offset().top - (window.innerHeight / 2) }, 200); }
Dug deeper into the source of the problem and found that the event listener for the submit button (that contained the scrolling code) was declared every time a popup was opened. I added linkfixes() and altfixes() execution in popupfixes() and removed execution of globalfixes() in popupfixes() to prevent the declaration from rerunning when popup is opened. It was then possible to uncomment the scrolling (accessibility requirement). I also added a verification that no answer was selected so it doesn't scroll when there is no error (scroll behind popup)
When a page is really big / contains a lot of interactions, there is a lag time when closing the popup.
Happens even when accessibility fixes is off so it's in the core of Adapt.