IntersectionObserver does not work on small screens for long sections JS

This script issues the active class for the active section. Recently noticed that it stops working on small screens. Even in the developer’s console in chrome, I will start to increase the screen size …