JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.34k stars 1.12k forks source link

[Web][Wasm] ComposeViewport introduced overscroll stretching animation #4672

Open egorikftp opened 2 months ago

egorikftp commented 2 months ago

Describe the bug I'm trying to migrate from CanvasBasedWindow to ComposeViewport we observe stretch animation (like overscroll on Android)

Affected platforms

Versions

To Reproduce

  1. Replace CanvasBasedWindow with ComposeViewport
  2. Replace <canvas id="youID"></canvas> with <div id="youID"></div>
  3. Observe stretching effect during vertical scroll

Expected behavior No animation

Screenshots CanvasBasedWindow

https://github.com/JetBrains/compose-multiplatform/assets/16294951/e89a4aef-5fa0-45fa-ad17-c4a7881e59a3

ComposeViewport

https://github.com/JetBrains/compose-multiplatform/assets/16294951/de2b8afe-93cd-4b78-926f-8b8695400e92

Additional context Can be easily reproduced in this branch https://github.com/ComposeGears/Tiamat/tree/feature/wasm

and this git patch overscroll.patch

Nek-12 commented 2 months ago

Actually, I would argue an overscroll animation is the expected behavior :)

PMARZV commented 2 months ago

@Nek-12 ive never seen a web with the ios-like overscroll shown in the video

Nek-12 commented 2 months ago

I always wanted web apps to have this feature. There are extensions that do this, there are websites that have this on purpose, there are apps that promise the same things. In fact, I think overscroll should be configurable

nevrozza commented 2 weeks ago

it works for me: (from https://github.com/nevrozza/PansionApp/blob/main/composeApp/src/wasmJsMain/resources/styles.css) `

composeApp {

width: 100%;
height: 100%;

} html, body { background-color: #2b2d30; margin: 0; padding: 0; width: 100%; height: 100%; display: flex; overflow: hidden; justify-content: center; align-items: center; } `