I Noticed in 1.4.0-rc01, `forEachGesture` got depr...
# compose-web
p
I Noticed in 1.4.0-rc01,
forEachGesture
got deprecated and suggested to replace with
awaitEachGesture
, however, when making the replacement ui breaks in a way that no more touches are given to other composables. The replacement works fine in the other platforms ios, android, desktop but not compose-js. The code looks like bellow. Perhaps I am doing some prohibited operation when using the new function:
Copy code
Box(
            modifier = Modifier
                .fillMaxSize()
                .pointerInput(childComponent) {
                    if (prevChildComponent == null) return@pointerInput
                    forEachGesture {
                        awaitPointerEventScope {
                            val eventDown = awaitFirstDown(requireUnconsumed = true)
                            if (eventDown.position.x < PredictiveBackAreaWidth) {
                                eventDown.consume()
                                val startX = eventDown.position.x
                                wasCancelled = false

                                do {
                                    val event: PointerEvent =
                                        awaitPointerEvent(PointerEventPass.Main)

                                    // some event processing code ...

                                } while (event.changes.any { it.pressed })

                                coroutineScope.launch {...}
                             }
                        }
                    }
                        ...
Above code breaks when replacing
forEachGesture
with
awaitEachGesture
then removing
awaitPointerEventScope
Copy code
Box(
            modifier = Modifier
                .fillMaxSize()
                .pointerInput(childComponent) {
                    if (prevChildComponent == null) return@pointerInput
                    awaitEachGesture {
                            val eventDown = awaitFirstDown(requireUnconsumed = true)
                            if (eventDown.position.x < PredictiveBackAreaWidth) {
                                eventDown.consume()
                                val startX = eventDown.position.x
                                wasCancelled = false

                                do {
                                    val event: PointerEvent =
                                        awaitPointerEvent(PointerEventPass.Main)

                                    // some event processing code ...

                                } while (event.changes.any { it.pressed })

                                coroutineScope.launch {...}
                             }
                    }
                        ...
The App becomes unresponsive to touch at all.