You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand I probably have a very niche use case, but here it is.
I am implementing a find functionality in my app (very very similar to vscode ctrl + f). When the user clicks the next arrow I want the view to scroll to the next result. If the result is in a row that is already loaded in the dom there is no issue as I can directly scroll to it (since I have its dom ref).
The problem arises when the next result is in a row that is not loaded because too far away. In that case I need to first call scrollToIndex to the row index, and only once it's scrolled and loaded I can do my own scrolling to the specific result within the row (a row could be arbitrarily long).
What I am currently trying to do is something like
The problem is that scrollToIndex could take an arbitrary amount of time to complete because of how scheduleImperativeScroll works, and always overrides my own scrollIntoView.
Making scrollToIndex (and hence scheduleImperativeScroll) awaitable would probably fix this issue.
I am also open to other solutions because honestly I'm out of ideas on how to properly implement this
The text was updated successfully, but these errors were encountered:
Worked like a charm! Unfortunately align center doesn't do much since the position is calculated with the offset, but with a bit or offset trickery I got it working! Thank you :)
I understand I probably have a very niche use case, but here it is.
I am implementing a find functionality in my app (very very similar to vscode ctrl + f). When the user clicks the next arrow I want the view to scroll to the next result. If the result is in a row that is already loaded in the dom there is no issue as I can directly scroll to it (since I have its dom ref).
The problem arises when the next result is in a row that is not loaded because too far away. In that case I need to first call
scrollToIndex
to the row index, and only once it's scrolled and loaded I can do my own scrolling to the specific result within the row (a row could be arbitrarily long).What I am currently trying to do is something like
The problem is that scrollToIndex could take an arbitrary amount of time to complete because of how scheduleImperativeScroll works, and always overrides my own scrollIntoView.
Making scrollToIndex (and hence scheduleImperativeScroll) awaitable would probably fix this issue.
I am also open to other solutions because honestly I'm out of ideas on how to properly implement this
The text was updated successfully, but these errors were encountered: