Norigin-Spatial-Navigation icon indicating copy to clipboard operation
Norigin-Spatial-Navigation copied to clipboard

Example scroll position incorrect when useGetBoundingClientRect: true

Open gsdev01 opened this issue 1 year ago • 1 comments

Hi, I would like first to thank you for the amazing work done here !

I have tried the example provided in the repo, but I soon as I turn on useGetBoundingClientRect option in the init object, scroll position when we scrollTo onFocus are wrong. Any idea on how to fix that ? I need useGetBoundingClientRect as I am using virtualized list (TanStack Virtual).

Any help would be much appreciated,

Thanks !

gsdev01 avatar Apr 22 '24 07:04 gsdev01

Thank you four reaching out.

Would you mind to share an example of what you're trying to achieve? The useGetBoundingClientRect option forces the engine to use the Element.getBoundingClientRect() method (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) which gives you the element coordinates relatively to the viewport.

Depending on how you structure your UI it might not be what you want.

xavi160 avatar May 10 '24 10:05 xavi160