does compose have a way of saying how much scrolli...
# compose
a
does compose have a way of saying how much scrolling is left towards a specific direction? aka can i scroll more towards the bottom of the page? EDIT: Yes ie use
rememberScrollState()
, but won't work for my case because I am not controlling the content i want to observe. Context for those curious: I am trying to get canvas based composables rendered on HTML to consume scroll events only if there is any scrolling that needs to be done. Right now if you scroll while on a composable, the whole page scrolls together with the composable itself. This is probably a Compose Web thing than Compose, so ignore this one 🙂
s
You might be looking for
canScrollForward
It doesn't tell you how much is left to scroll, but can tell you if the scroll is finished
a
I dont think this can work in my case because i dont control the scrollable content. I am trying to figure out if the children of a composable can be scrolled or not. my real use case is this: https://composablesui.com/components/preview check the 'simple list' or 'settings' example on desktop. if u scroll on that preview the whole page scrolls. in code, think of it like:
Copy code
ExamplePreview {  
   DynamicContent() //<- can the contents of this scroll or not?
}
i think i need to look at the source code of
CanvasBasedWindow
and see how things are wired. i doubt the above can be handled by compose apis
s
I think you can look into nested scroll connection or similar, but I don't think compose supplies any info about scroll layout size by default
a
good point. will have a look look
now i see what you mean by 'no info about scroll layout size'. the connector is telling me how much each gesture can scroll but not about the total available scroll size
s
This might have to be addressed within Compose(/Web) itself, it should consume the scroll events it receives from the DOM if they're consumed by any Composable in the UI.
a