https://kotlinlang.org logo
#compose-web
Title
# compose-web
g

Giorgi

01/28/2023, 11:56 AM
Hi, created a columnt with
.verticalScroll(rememberScrollState())
and added lots of
Text("asdf")
but it does not scroll. In console I see a messge
Object { message: "An operation is not implemented: implement js setter for rawPosition", cause: undefined, name: "NotImplementedError"
so... There is no scroll functionality implemented for Compose with Skia? sad panda
b

burnoo

01/28/2023, 2:37 PM
For LazyList I’ve found the following workaround:
Copy code
val scope = rememberCoroutineScope()
val listState = rememberLazyListState()
// ...
LazyColumn(
    state = listState,
    modifier = Modifier.onPointerEvent(PointerEventType.Scroll) {
        scope.launch {
            listState.scrollBy((it.nativeEvent as SkikoPointerEvent).deltaY.toFloat())
        }
    },
    userScrollEnabled = false,
    content = content,
)
Working demo: https://burnoo.github.io/DemoListApp/ Doesn’t work with touch screens though, couldn’t find workaround for that. You should be able to do something very similar with
rememberScrollState()
g

Giorgi

01/30/2023, 5:56 PM
Nice, it works very nice 🚀
21 Views