Within the realm of reactjs, I've crafted a function that smoothly scrolls elements by utilizing a useRef:
ref.current?.scrollIntoView({
behavior: "smooth",
block: "nearest",
inline: "center",
});
An interesting observation is that when multiple calls to this function are made simultaneously on different elements, only the first called element actually undergoes scrolling.
This raises the question - can multiple elements be scrolled at once?
If indeed achievable, what errors might I be committing unknowingly in my code?