This library is working great when I click an element to scroll to, but when I call the same function programatically with key up/down or some ui buttons, it doesn't end up in the same position.
Have recorded a screen capture, you'll notice it works fine when clicking on an element, with the programatic call it actually works okay when going up but not when going down, the element just hides below the edge a little bit. Not sure what could be the difference on a click vs not.
This library is working great when I click an element to scroll to, but when I call the same function programatically with key up/down or some ui buttons, it doesn't end up in the same position.
Have recorded a screen capture, you'll notice it works fine when clicking on an element, with the programatic call it actually works okay when going up but not when going down, the element just hides below the edge a little bit. Not sure what could be the difference on a click vs not.
https://github.com/user-attachments/assets/bd89e483-443b-4a8c-b039-132b52d0f17b
I have tried to also call the element into focus explicitly, and using a scroll-margin property, neither have had any effect.