How to convert this into overlayscrollbars-react
v2? seems like scroll function
is not working in latest version.
React.useEffect(
function scrollSelectedItemIntoView() {
overlayScrollbarsRef.current?.osInstance().scroll({
el: selectedItemRef.current,
scroll: {
y: 'ifneeded',
x: 'never',
},
})
},
[selectedIndex],
)
I am expecting similar behavior in this codesandbox link. Click on Suggestions
tab and type @
when you press up & down keys the scrollbar will also scroll based on the selectedIndex of user.
https://codesandbox.io/s/tiptap-0sqm3i?file=/src/extensions/suggestions/SuggestionDropdown.tsx:1061-1405
I have reached out to the dev of the package itself and he response with an updated solution.
Updated Solution: https://codesandbox.io/s/elated-lucy-7igb9n?file=/src/extensions/suggestions/SuggestionDropdown.tsx
Github Closed Issue: https://github.com/KingSora/OverlayScrollbars/issues/513