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
Currently the Scrollable demos only showcase the ability to control the scroll using the dedicated <Scrollable.VerticalScrollbar> component, which has a unique access to the context.
This ability (control the scroll position) is also important to have from any other component on the page.
Below is a non-tested idea for such a demo:
constgetVerticalMiddleDistanceInPx=elem=> ...
constOutsideScrollControl=({children})=>{constscrollRef=useRef();constscrollTo=(top,left)=>{scrollRef.current.scroll({top, left,behavior: 'smooth'})}return<><buttononClick={scrollTo(0)}>scroll to top</button><buttononClick={scrollTo(getVerticalMiddleDistanceInPx(scrollRef.current))}>scroll to middle</button><buttononClick={scrollTo(100,100)}>scroll 100px vertical & horizontal</button><Scrollableelement={<divref={scrollRef}/>}>
imagine long content...
</Scrollable></>}
The text was updated successfully, but these errors were encountered:
Currently the Scrollable demos only showcase the ability to control the scroll using the dedicated
<Scrollable.VerticalScrollbar>
component, which has a unique access to thecontext
.This ability (control the scroll position) is also important to have from any other component on the page.
Below is a non-tested idea for such a demo:
The text was updated successfully, but these errors were encountered: