If I like something to seize global event to scroll in the DOM?

In my react app has a list of people.Which are assigned to the case.The case can be assigned so that it is passed from person to person. That is, you write a case for each person added from the select sample.

the point is that I render, eksemplar SunEditor editor when adding a new person to a case.

when you add a new eksemplara SunEditor why I skrait to the bottom.I have not found any code that would be responsible for this functionality in SunEditor.And I thought if I can intercept the scrolling of the document and cancel it event.preventDefault().

P. S. so I do not know what id have DIVS, which are cleaved as ID element is math.random()
April 4th 20 at 13:00
1 answer
April 4th 20 at 13:02
Event for scroll you can catch, like so:
window.addEventListener('scroll', function() {
 document.getElementById('showScroll').innerHTML = pageYOffset + 'px';
});

Can't prevent the scrolling using the event.preventDefault() in the handler, onscroll, because it fires after the scroll has already happened.
But you can prevent the scrolling using the event.preventDefault() on the event that causes the scrolling, for example, the keydown event for the keys pageUp and pageDown.

Find more questions by tags JavaScript