Scroll to the top on the next document (ner/spans)

Hello! I am working with long documents (couple of screens long), and there is no way to break them into fragments, as the context is important. So, to read through the document, I naturally scroll from the beginning to the end, highlighting relevant entities or spans, depending on a recipe. When I click "accept" or "ignore" or "previous" button, the next document shows up scrolled to the bottom, so I have to scroll to the top of the document every time. Is there any way to force prodigy to show every new document from the beginning (i.e. reset scroll position to the very top)?

Hi @nrodnova,

You could adjust the default scrolling behavior with a little bit of javascript.
You could add a listener to prodigyanswer event (that fires whenever the user submits the answer) that would scroll intro view the main Prodigy container. To cover the "previous", you'd need a listener for the clicking event on this button that would do essentially the same thing.
Your custom js code could look like this:

const container = document.querySelector('.prodigy-container');
const undoButton = document.querySelector('.prodigy-button-undo');

const scrollToContainer = () => container.scrollIntoView();

document.addEventListener('prodigyanswer', scrollToContainer);
undoButton.addEventListener('click', scrollToContainer);

You can load it by putting this file in a dedicated directory e.g. custom_js and refer this directory in you prodigy.json:

{
"javascript_dir": "/path/to/custom_js"
}

You can find more information on the javascript events and css classes that Prodigy exposes for easier customization[ here.](https://prodi.gy/docs/custom-interfaces#js-css)