diff --git a/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/Scroll.js.kt b/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/Scroll.js.kt index d7007fb1..753bb04e 100644 --- a/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/Scroll.js.kt +++ b/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/Scroll.js.kt @@ -28,10 +28,12 @@ val imitateComposeUiLayoutHorizontalScrollPlatformModifier = @Composable actual fun rememberScrollState(initial: Int): ScrollState = - ScrollState + ScrollState() + +// used to be `actual object`, but but Dokka fails with it @Stable -actual object ScrollState +actual class ScrollState actual fun Modifier.verticalScroll(state: ScrollState): Modifier = platformModify { verticalScroll() } diff --git a/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyDsl.js.kt b/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyDsl.js.kt index ec7c1d86..54434d00 100644 --- a/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyDsl.js.kt +++ b/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyDsl.js.kt @@ -29,7 +29,7 @@ actual class LazyListScope { contentType: Any?, content: @Composable LazyItemScope.() -> Unit, ) = - addComposable { LazyItemScope.content() } + addComposable { LazyItemScope().content() } actual fun items( count: Int, @@ -39,7 +39,7 @@ actual class LazyListScope { ) = addComposable { repeat(count) { index -> - LazyItemScope.itemContent(index) + LazyItemScope().itemContent(index) } } } diff --git a/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyItemScope.js.kt b/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyItemScope.js.kt index 03ba111e..23084a17 100644 --- a/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyItemScope.js.kt +++ b/common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyItemScope.js.kt @@ -12,7 +12,8 @@ import com.huanshankeji.compose.ui.Modifier @LazyScopeMarker @JvmDefaultWithCompatibility */ -actual object LazyItemScope { +// used to be `actual object`, with which Dokka fails +actual class LazyItemScope { // I am not sure whether these implementations work perfectly. actual fun Modifier.fillParentMaxSize(