I’m relying on a very basic use of scrollIntoView() scroll-behavior:smooth
to ensure the current line of a multi-line text is scrolled along with a user’s typing in a different input.
The issue is if a user types very fast or types short phrases, scrollIntoView() can be called multiple times before the previous scrollIntoView() action completes. This results in a jittery visual scrolling effect due to the easing of the scroll-behavior:smooth.
How can I repeatedly call scrollIntoView() scroll-behavior:smooth
but have it only engage if the previous scroll has completed and is no longer in action?