Status Update
Comments
se...@gmail.com <se...@gmail.com> #2
kl...@google.com <kl...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha06
androidx.compose.foundation:foundation-android:1.8.0-alpha06
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha06
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha06
se...@gmail.com <se...@gmail.com> #4
ja...@deepl.com <ja...@deepl.com> #5
We're also seeing a bunch of these crashes with different ranges, e.g.
java.lang.IllegalArgumentException: offset(3) is out of bounds [0, 3)
java.lang.IllegalArgumentException: offset(17) is out of bounds [0, 9)
It seems to only happen on some Huawei Devices: ELE-L29
, PCT-L29
, LYA-L29
I don't have a Huawei Device to test. Maybe it's related to a custom Huawei keyboard?
I observed some malfunctions of the TextField
with other Keyboards as well (e.g. Text selection with the Samsung Keyboard).
bl...@gmail.com <bl...@gmail.com> #6
It seems to only happen on some Huawei Devices
I've just had it occur randomly on Nokia G20:
java.lang.IllegalArgumentException: offset(13) is out of bounds [0, 0)
at androidx.compose.ui.text.MultiParagraph.requireIndexInRange(MultiParagraph.kt:749)
AOSP keyboard btw (not GBoard)
[Deleted User] <[Deleted User]> #7
Compose Version: 1.1.1
Kotlin (gradle plugin) Version: 1.6.10
Build tool version: 7.1.3
compileSdk: 32
Device: V2045 (vivo x60)
Android Version: 12
Stack Trace:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 25374
java.lang.IllegalArgumentException: offset(196) is out of bounds [0, 136]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:593)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.kt:442)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:390)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager.getContentRect(TextFieldSelectionManager.kt:635)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager.showSelectionToolbar$foundation_release(TextFieldSelectionManager.kt:597)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager$touchSelectionObserver$1.onStop(TextFieldSelectionManager.kt:215)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesAfterLongPressWithObserver$3.invoke(LongPressTextDragObserver.kt:37)
at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesAfterLongPressWithObserver$3.invoke(LongPressTextDragObserver.kt:36)
at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGesturesAfterLongPress$5$1.invokeSuspend(DragGestureDetector.kt:300)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:511)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:406)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:419)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:310)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:179)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:98)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:80)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1159)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1109)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1059)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3201)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2866)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3201)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2866)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3201)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2866)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3201)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2866)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:682)
E/AndroidRuntime: at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1971)
at android.app.Activity.dispatchTouchEvent(Activity.java:4383)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:634)
at android.view.View.dispatchPointerEvent(View.java:14945)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6743)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6513)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5970)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6037)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5998)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6171)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6006)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6228)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5974)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6037)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5998)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6006)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5974)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9049)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9000)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8960)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9184)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:276)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:339)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8278)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.BroadcastFrameClock@d69341a, StandaloneCoroutine{Cancelling}@9c74b4b, AndroidUiDispatcher@9ce1928]
I'm using OutlinedTextField with TextFieldValue and custom VisualTransformation. If you want to reproduce this issue you can use this apk.
Steps to reproduce:
- Select the last word (together) in the outlinedTextField
Apk Drive Link:
Crash Video Drive Link:
si...@google.com <si...@google.com> #8
since it is a crash will mark as P1.
[Deleted User] <[Deleted User]> #9
Is there any way to disable the text selection in the TextField? At least we can deploy our feature without text selection until this issue get resolved.
pi...@gmail.com <pi...@gmail.com> #10
th...@gmail.com <th...@gmail.com> #11
st...@google.com <st...@google.com> #12
Would you mind sharing the code for
[Deleted User] <[Deleted User]> #13
I have checked only compose 1.1.1 as migrating to compose 1.2 and above leading to some side effects in our compose app. So need to migrate with care. Meanwhile, below is the project file for the sample project causing the error.
[Deleted User] <[Deleted User]> #14
Also, Crashing in 1.2.0-rc03 with kotlin version 1.7.0
[Deleted User] <[Deleted User]> #15
Any updates?
[Deleted User] <[Deleted User]> #16
Any updates?
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 2858b9e78538908fc3ce28ad346321fd014ae55b
Author: Zach Klippenstein <klippenstein@google.com>
Date: Fri Jul 15 18:49:53 2022
Validate the indices returned by OffsetMappings and throw better exceptions.
Instances of OffsetMapping are provided by developers when passing a
custom VisualTransformation to a text field. Those offset mappings must
correctly map indices between the original and transformed strings.
However, it is very easy to write a mapping that returns invalid indices
that are outside of the actual strings. When that happens, the text
internals eventually throw an exception, but it's not very helpful. This
change explicitly validates the returned values on every call, and if
they're invalid, throws an exception with a more detailed error message
that can hopefully help developers troubleshoot what's wrong.
The validation is performed by wrapping the OffsetMapping in one that
knows the lengths of the original and transformed text, and then using
that wrapper everywhere we perform the mapping.
This change adds UI tests that validate the detailed exception is being
thrown when interacting with cursor and selection in a text field that
has an invalid mapping.
Bug:
Test: ./gradlew :compose:f:f:test
Relnote: "Text fields will now throw more detailed exceptions when the
`OffsetMapping` provided by a `VisualTransformation` returns invalid
indices."
Change-Id: Ie73f9a652c29dde66d073a868a2e1c181feaa98d
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/api/current.txt
A compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/ValidatingOffsetMappingTest.kt
M compose/foundation/foundation/build.gradle
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldVisualTransformationSelectionBoundsTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/ValidatingOffsetMapping.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldScroll.kt
al...@mercari.com <al...@mercari.com> #18
Can anyone confirm if this is fixed in 1.2.1?
[Deleted User] <[Deleted User]> #19
There is a major flaw in the VisualTransformation Logic. The visual transformation (along with offset mapping) can only work if the transformed text is larger or equal to the original text. The visual transformation fails in case the original text is larger than the transformed text. Below I am sharing Credit Card Example:
Original Text -> "1234-5678-9012-3456"
Transformed Text -> "1234567890123456"
Note: This is the exact reverse of the example given in the doc. Here we want the transformed text to be smaller than the original text.
Compose Version: 1.3.0-alpha03
Code:
class CredCardTransformation() : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
// Sending "1234567890123456" directly just to test
return TransformedText(AnnotatedString(text = "1234567890123456"), creditCardOffsetTranslator)
}
}
// Original example - just reversed the mappers.
val creditCardOffsetTranslator = object : OffsetMapping {
override fun transformedToOriginal(offset: Int): Int {
if (offset <= 3) return offset
if (offset <= 7) return offset + 1
if (offset <= 11) return offset + 2
if (offset <= 16) return offset + 3
return 19
}
override fun originalToTransformed(offset: Int): Int {
if (offset <= 4) return offset
if (offset <= 9) return offset - 1
if (offset <= 14) return offset - 2
if (offset <= 19) return offset - 3
return 16
}
}
/**
* UI Code
**/
val input = remember {
mutableStateOf("1234-5678-9012-3456") // Static Text
}
val textFieldValue = remember {
mutableStateOf(TextFieldValue(text = input.value))
}
BasicTextField(
value = textFieldValue.value,
onValueChange = {
textFieldValue.value = it
},
visualTransformation = CredCardTransformation(),
)
Given this code, if we try to select all the text. This code will fail immediately with a crash. Below is the stack trace of the error.
Process: com.example.myapplication, PID: 25958
java.lang.IllegalArgumentException: offset(18) is out of bounds [0, 16]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:756)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.kt:605)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:529)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager.getContentRect(TextFieldSelectionManager.kt:727)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager.showSelectionToolbar$foundation_release(TextFieldSelectionManager.kt:662)
at androidx.compose.foundation.text.CoreTextFieldKt.SelectionToolbarAndHandles(CoreTextField.kt:989)
at androidx.compose.foundation.text.CoreTextFieldKt.access$SelectionToolbarAndHandles(CoreTextField.kt:1)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1$1.invoke(CoreTextField.kt:614)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1$1.invoke(CoreTextField.kt:561)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.selection.SimpleLayoutKt.SimpleLayout(SimpleLayout.kt:79)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:561)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:540)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2653)
at androidx.compose.foundation.text.ComposableSingletons$BasicTextFieldKt$lambda-2$1.invoke(BasicTextField.kt:281)
at androidx.compose.foundation.text.ComposableSingletons$BasicTextFieldKt$lambda-2$1.invoke(BasicTextField.kt:281)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:540)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:539)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2653)
at androidx.compose.foundation.text.ContextMenu_androidKt.ContextMenuArea(ContextMenu.android.kt:29)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextFieldRootBox(CoreTextField.kt:640)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextField(CoreTextField.kt:539)
at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:283)
at com.example.myapplication.ComposableSingletons$MainActivityKt$lambda-1$1$1$1$1.invoke(MainActivity.kt:40)
at com.example.myapplication.ComposableSingletons$MainActivityKt$lambda-1$1$1$1$1.invoke(MainActivity.kt:39)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2363)
E/AndroidRuntime: at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2630)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3227)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3205)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:336)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3205)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3170)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:748)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:876)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:107)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:485)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:454)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1184)
at android.view.Choreographer.doCallbacks(Choreographer.java:986)
at android.view.Choreographer.doFrame(Choreographer.java:907)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1171)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8278)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@65f48d5, androidx.compose.ui.platform.MotionDurationScaleImpl@88118ea, StandaloneCoroutine{Cancelling}@38b17db, AndroidUiDispatcher@1e01278]
am...@gmail.com <am...@gmail.com> #20
ValidatingOffsetMapping seems to be broken. Having lots of runtime crashes:
IllegalStateException: OffsetMapping.transformedToOriginal returned invalid mapping: 7 -> 6 is not in range of original text [0, 0]
at androidx.compose.foundation.text.ValidatingOffsetMapping.transformedToOriginal(ValidatingOffsetMapping.kt:69)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.setCursorOffset-ULxng0E$foundation_release(TextFieldDelegate.kt:174)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:337)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:332)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:82)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:55)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:389)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1327)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1273)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1212)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:572)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1895)
at android.app.Activity.dispatchTouchEvent(Activity.java:4274)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:530)
at android.view.View.dispatchPointerEvent(View.java:15117)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6663)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6458)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5901)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6089)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6146)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8906)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8857)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8825)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9042)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:281)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:256)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8988)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:9128)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1160)
at android.view.Choreographer.doCallbacks(Choreographer.java:950)
at android.view.Choreographer.doFrame(Choreographer.java:871)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1142)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8319)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@c0cda3d, androidx.compose.runtime.BroadcastFrameClock@425b232, StandaloneCoroutine{Cancelling}@5044b83, AndroidUiDispatcher@c284100]
Happens when empty field with transformed mask (XXX-XXX) looses focus and obtains it again.
Transformation code:
object ConfirmationCodeVisualTransformation : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
// XXX-XXX mask
val tLength = text.length
val noHyphen = tLength < 4 || text[3] != '-'
val transformed = if (noHyphen || tLength < 7) {
buildAnnotatedString {
append(text.subSequence(0, min(tLength, 3)))
val idx = if (noHyphen) 3 else 4
if (tLength > idx) {
append('-')
append(text.subSequence(idx, tLength))
}
if (length < 7) {
append("XXX-XXX".substring(length, 7))
}
}
} else {
text
}
return TransformedText(transformed, ConfirmationCodeOffsetMapping(!noHyphen))
}
}
private class ConfirmationCodeOffsetMapping(
private val hasHyphen: Boolean,
) : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
return when {
offset <= 2 || hasHyphen -> offset
offset <= 5 -> offset + 1
else -> 7
}
}
override fun transformedToOriginal(offset: Int): Int {
return when {
offset <= 3 || hasHyphen -> offset
offset <= 7 -> offset - 1
else -> 6
}
}
}
po...@gmail.com <po...@gmail.com> #21
java.lang.IllegalStateException: OffsetMapping.transformedToOriginal returned invalid mapping: 5 -> 1 is not in range of original text [0, 0]
at androidx.compose.foundation.text.ValidatingOffsetMapping.transformedToOriginal(ValidatingOffsetMapping.kt:69)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.setCursorOffset-ULxng0E$foundation_release(TextFieldDelegate.kt:174)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:337)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:332)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:82)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:55)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:234)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:389)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1327)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1273)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1212)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
E/AndroidRuntime: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:465)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1849)
at android.app.Activity.dispatchTouchEvent(Activity.java:4011)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:423)
at android.view.View.dispatchPointerEvent(View.java:14212)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5652)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5455)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5011)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4977)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5117)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4985)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5174)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5011)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4977)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4985)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4958)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7675)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7644)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7605)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7800)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:188)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@8c5a481, androidx.compose.runtime.BroadcastFrameClock@10c8926, StandaloneCoroutine{Cancelling}@d842967, AndroidUiDispatcher@28d3314]
I/Process: Sending signal. PID: 25981 SIG: 9
Happens on compose foundation '1.3.0-alpha03' and later. I have to strictly stay on '1.3.0-alpha02'. It works fine
implementation('androidx.compose.foundation:foundation:1.3.0-beta01') { version { strictly '1.3.0-alpha02' } }
Crashes every time when i try to get focus
const val MAX_NUMBERS = 10
private const val PHONE_MASK = "+7 (___) ___-__-__"
val prefix = PHONE_MASK.substring(1, PHONE_MASK.indexOfFirst { it == ' ' })
private fun mobileNumberFilter(
text: AnnotatedString,
color: Color,
textStyle: TextStyle
): TransformedText {
val trimmed = if (text.text.length >= MAX_NUMBERS) text.text.take(MAX_NUMBERS) else text.text
val annotatedString = AnnotatedString.Builder().run {
pushStyle(getSpanStyle(color, textStyle))
append(PHONE_MASK.substring(0, prefix.length + 2))
for (i in trimmed.indices) {
if (i == 0) {
append('(')
}
append(trimmed[i])
if (i == 2) {
append(") ")
}
if (i == 5 || i == 7) {
append('-')
}
}
pushStyle(getSpanStyle(Color.LightGray, textStyle))
append(PHONE_MASK.takeLast(PHONE_MASK.length - length))
toAnnotatedString()
}
val phoneNumberOffsetTranslator = object : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
if (offset <= 3) return offset + 4
if (offset <= 6) return offset + 6
if (offset <= 8) return offset + 7
if (offset <= MAX_NUMBERS) return offset + 8
return PHONE_MASK.length
}
override fun transformedToOriginal(offset: Int): Int {
if (offset <= 4) return 0
if (offset <= 9) return offset - 4
if (offset <= 13) return offset - 6
if (offset <= 16) return offset - 7
if (offset <= 18) return offset - 8
return MAX_NUMBERS
}
}
return TransformedText(annotatedString, phoneNumberOffsetTranslator)
}
nf...@gmail.com <nf...@gmail.com> #22
Guys, I found that this crash for some reason is connected to the Stripe lib:
I mean, before I added that lib to the project - just in the build.gradle as dependency, that code worked, but after that - crashes 100%.
[Deleted User] <[Deleted User]> #23
any updates team google?
th...@gmail.com <th...@gmail.com> #24
hi...@gmail.com <hi...@gmail.com> #25
am...@gmail.com <am...@gmail.com> #26
Dear Googlers, please do something. Compose 1.3 is already in RC stage, but it has completely broken text VisualTransformation
/OffsetMapping
.
ValidatingOffsetMapping
broke it in 1.3.0-alpha03, it is completely unusable since then.
hm...@gmail.com <hm...@gmail.com> #27
com.google.android.material:material:1.6.1 & compose 1.2.1
dj...@gmail.com <dj...@gmail.com> #28
dj...@gmail.com <dj...@gmail.com> #29
am...@gmail.com <am...@gmail.com> #30
And at least since 1.4.0-alpha02
compose libs are binary incompatible with androidx-compose-foundation:1.3.0-alpha02
.
So strict version is no longer the option here without proper fix :(
ja...@gmail.com <ja...@gmail.com> #31
ap...@google.com <ap...@google.com> #32
Branch: androidx-main
commit 9ac08cafc1b343f1e77adc7eb76f065a99ddf967
Author: Halil Ozercan <halilibo@google.com>
Date: Thu Dec 01 04:15:33 2022
Use correct offsets for transformed and original states in TextField during selection and showing magnifier.
When showing selection toolbar, content rect area was being calculated by using the original offset of characters. This can cause unexpected errors, most probably out-of-range exceptions when a reduced visual transformation (shorter transformed text than the original) is applied.
While calculating the center for magnifier, transformed offset was coerced using the original value of TextField. This is now fixed and it uses transformedText length.
One small change is also made along the same lines to `TextPreparedSelection`. It used original selection.end while deciding on paragraph direction which again may cause IndexOutOfBounds exception. This raw offset is now transformed before being queried.
Test: ./gradle :compose:foundation:foundation:cAT
Bug:
Change-Id: I92b1612e4c8009defc7def58d4fd955c18165eae
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/TextFieldVisualTransformationMagnifierTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldSelectionTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextPreparedSelection.kt
[Deleted User] <[Deleted User]> #33
se...@gmail.com <se...@gmail.com> #34
Seeing this issue with Compose 1.3.1
as well might be related
se...@gmail.com <se...@gmail.com> #35
Is there any good workaround while we wait for this to be fixed? I cannot consistently reproduce it either, but I have seen it a few times and it is very common in crashlytics
Seconding this - would love to have a workaround until the fix gets baked. This is affecting users in the wild 🙁
ra...@gmail.com <ra...@gmail.com> #36
Possible temporary workaround is to ensure that value returned in transformedToOriginal
is not greater than original text length. For my date field masked with DD-MM-YYYY
it seems to work fine.
class Date(private val mask: String = "DD-MM-YYYY") : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
val trimmed = text.text.let { if (it.length >= 8) it.substring(0..7) else it }
val annotatedString = AnnotatedString.Builder().apply {
for (i in trimmed.indices) {
append(trimmed[i])
if (i == 1 || i == 3) {
append("-")
}
}
append(mask.takeLast(mask.length - length))
}.toAnnotatedString()
val dateOffsetMapping = object : OffsetMapping {
override fun originalToTransformed(offset: Int): Int {
if (offset <= 1) return offset
if (offset <= 3) return offset + 1
if (offset <= 7) return offset + 2
return 10
}
override fun transformedToOriginal(offset: Int): Int {
return when {
offset <= 2 -> offset
offset <= 5 -> offset - 1
offset <= 9 -> offset - 2
else -> 8
}.coerceAtMost(text.length)
}
}
return TransformedText(annotatedString, dateOffsetMapping)
}
}
kl...@google.com <kl...@google.com> #37
The latest fix hasn't been released yet, it should be out in the next release, probably next week.
am...@gmail.com <am...@gmail.com> #38
Next week passed, any updates?
ha...@google.com <ha...@google.com> #39
The latest fix was part of 1.4.0-alpha04 release of foundation. Please give it a try. If your problem persists, please provide a minimal repro project.
Also make sure that you are upgrading foundation version, not just material module that pulls in foundation.
implementation("androidx.compose.foundation:foundation:1.4.0-alpha04") // or the latest alpha05
st...@google.com <st...@google.com>
am...@gmail.com <am...@gmail.com> #40
Not completely fixed in androidx.compose.foundation:foundation:1.4.0-alpha04
, 1.4.0-alpha05
, or 1.4.0-beta01
.
Now it's harder to catch it manually, but occasionally it happens. After release, we see a lot of crashes.
Just try to repeatedly write/remove/cut/paste something e.g. with ConfirmationCodeVisualTransformation
from my
Example stack trace:
java.lang.IllegalStateException: OffsetMapping.transformedToOriginal returned invalid mapping: 7 -> 6 is not in range of original text [0, 5]
at androidx.compose.foundation.text.ValidatingOffsetMapping.transformedToOriginal(ValidatingOffsetMapping.kt:69)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.setCursorOffset-ULxng0E$foundation_release(TextFieldDelegate.kt:225)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke-k-4lQ0M(CoreTextField.kt:341)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$pointerModifier$1.invoke(CoreTextField.kt:336)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke-k-4lQ0M(TextFieldPressGestureFilter.kt:82)
at androidx.compose.foundation.text.TextFieldPressGestureFilterKt$tapPressTextFieldModifier$1$2$2.invoke(TextFieldPressGestureFilter.kt:55)
at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1.invokeSuspend(TapGestureDetector.kt:255)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:566)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:456)
at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:469)
at androidx.compose.ui.node.BackwardsCompatNode.onPointerEvent-H0pRuoY(BackwardsCompatNode.kt:370)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:314)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:301)
at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:183)
at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:102)
at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:98)
at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1343)
at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1289)
at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1228)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3131)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2812)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:572)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1895)
at android.app.Activity.dispatchTouchEvent(Activity.java:4274)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:530)
at android.view.View.dispatchPointerEvent(View.java:15117)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6663)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6458)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5901)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6089)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6146)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5958)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5924)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5932)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5905)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8906)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8857)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8825)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9042)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:281)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:340)
at android.os.Looper.loopOnce(Looper.java:168)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8319)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@24fd51, androidx.compose.runtime.BroadcastFrameClock@294b9b6, StandaloneCoroutine{Cancelling}@2acb6b7, AndroidUiDispatcher@bbfbe24]
an...@mamkin.dev <an...@mamkin.dev> #41
I have an outlinedtextfield with trailing and leading icon
it crashes on longclick on trailing or leading icon (only first time, if long click is not first action - the crash doesn't happen)
my project for reproduce is in attachements
19:21:56.681 E FATAL EXCEPTION: main
Process: dev.mamkin.composeviewmodel, PID: 6518
java.lang.IllegalArgumentException: offset(4) is out of bounds [0, 4)
at androidx.compose.ui.text.MultiParagraph.requireIndexInRange(MultiParagraph.kt:771)
at androidx.compose.ui.text.MultiParagraph.getBoundingBox(MultiParagraph.kt:505)
at androidx.compose.ui.text.TextLayoutResult.getBoundingBox(TextLayoutResult.kt:527)
at androidx.compose.foundation.text.selection.TextFieldSelectionManagerKt.calculateSelectionMagnifierCenterAndroid-O0kMr_c(TextFieldSelectionManager.kt:868)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager_androidKt$textFieldMagnifier$1$1.invoke-F1C5BW0(TextFieldSelectionManager.android.kt:51)
at androidx.compose.foundation.text.selection.TextFieldSelectionManager_androidKt$textFieldMagnifier$1$1.invoke(TextFieldSelectionManager.android.kt:49)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.DerivedSnapshotState.currentRecord(DerivedState.kt:161)
at androidx.compose.runtime.DerivedSnapshotState.getDependencies(DerivedState.kt:236)
at androidx.compose.runtime.CompositionImpl.recordReadOf(Composition.kt:736)
at androidx.compose.runtime.Recomposer$readObserverOf$1.invoke(Recomposer.kt:1094)
at androidx.compose.runtime.Recomposer$readObserverOf$1.invoke(Recomposer.kt:1094)
at androidx.compose.runtime.DerivedSnapshotState.getValue(DerivedState.kt:221)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.rememberAnimatedMagnifierPosition$lambda$1(SelectionMagnifier.kt:126)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.access$rememberAnimatedMagnifierPosition$lambda$1(SelectionMagnifier.kt:1)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.rememberAnimatedMagnifierPosition(SelectionMagnifier.kt:83)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt.access$rememberAnimatedMagnifierPosition(SelectionMagnifier.kt:1)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt$animatedSelectionMagnifier$1.invoke(SelectionMagnifier.kt:68)
at androidx.compose.foundation.text.selection.SelectionMagnifierKt$animatedSelectionMagnifier$1.invoke(SelectionMagnifier.kt:67)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:265)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:260)
at androidx.compose.ui.Modifier$Element.foldIn(Modifier.kt:115)
at androidx.compose.ui.ComposedModifierKt.materialize(ComposedModifier.kt:260)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:266)
at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:260)
at androidx.compose.ui.Modifier$Element.foldIn(Modifier.kt:115)
at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:301)
at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:301)
at androidx.compose.ui.ComposedModifierKt.materialize(ComposedModifier.kt:260)
at androidx.compose.ui.layout.LayoutKt$materializerOf$1.invoke-Deg8D_g(Layout.kt:191)
at androidx.compose.ui.layout.LayoutKt$materializerOf$1.invoke(Layout.kt:190)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.selection.SimpleLayoutKt.SimpleLayout(SimpleLayout.kt:75)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:590)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:565)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
19:21:56.681 E at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2465)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2756)
at androidx.compose.material3.OutlinedTextFieldKt.OutlinedTextFieldLayout(OutlinedTextField.kt:463)
at androidx.compose.material3.TextFieldImplKt$CommonDecorationBox$3.invoke-RIQooxk(TextFieldImpl.kt:206)
at androidx.compose.material3.TextFieldImplKt$CommonDecorationBox$3.invoke(TextFieldImpl.kt:113)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:179)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.material3.TextFieldTransitionScope.Transition-DTcfvLk(TextFieldImpl.kt:329)
at androidx.compose.material3.TextFieldImplKt.CommonDecorationBox(TextFieldImpl.kt:103)
at androidx.compose.material3.TextFieldDefaults.OutlinedTextFieldDecorationBox(TextFieldDefaults.kt:649)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2$2.invoke(OutlinedTextField.kt:190)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2$2.invoke(OutlinedTextField.kt:189)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:565)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:564)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2465)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2756)
at androidx.compose.foundation.text.ContextMenu_androidKt.ContextMenuArea(ContextMenu.android.kt:29)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextFieldRootBox(CoreTextField.kt:670)
at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextField(CoreTextField.kt:564)
at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:161)
at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:332)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2.invoke(OutlinedTextField.kt:163)
at androidx.compose.material3.OutlinedTextFieldKt$OutlinedTextField$2.invoke(OutlinedTextField.kt:161)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.material3.OutlinedTextFieldKt.OutlinedTextField(OutlinedTextField.kt:161)
at dev.mamkin.composeviewmodel.TradingInputViewKt.TradingInputView(TradingInputView.kt:58)
at dev.mamkin.composeviewmodel.TradingInputViewKt$TradingInputView$6.invoke(Unknown Source:14)
at dev.mamkin.composeviewmodel.TradingInputViewKt$TradingInputView$6.invoke(Unknown Source:10)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2465)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2733)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3364)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3342)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3342)
al...@gmail.com <al...@gmail.com> #42
I'm running compose version: 1.4.2
java.lang.IllegalArgumentException: offset(4) is out of bounds [0, 3]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:777)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.kt:626)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:547)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.jumpByLinesOffset(TextPreparedSelection.kt:304)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.moveCursorUpByLine(TextPreparedSelection.kt:213)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:116)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.kt:104)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.kt:224)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.kt:104)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:258)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:258)
at androidx.compose.ui.input.key.KeyInputInputModifierNodeImpl.onKeyEvent-ZmokQxo(KeyInputModifierNode.kt:97)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-ZmokQxo(FocusOwnerImpl.kt:180)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:631)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:639)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:453)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1839)
at android.app.Activity.dispatchKeyEvent(Activity.java:3953)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:126)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:367)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5413)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5281)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4980)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5141)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3064)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2607)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2598)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3041)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
ca...@checkout-mo.caspeco.se <ca...@checkout-mo.caspeco.se> #43
kotlin version: 1.8.20
Stacktrace:
Fatal Exception: java.lang.IllegalArgumentException: offset(2) is out of bounds [0, 1]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:777)
at androidx.compose.ui.text.MultiParagraph.getParagraphDirection(MultiParagraph.kt:573)
at androidx.compose.ui.text.TextLayoutResult.getParagraphDirection(TextLayoutResult.kt:500)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.isLtr(BaseTextPreparedSelection.java:254)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.moveCursorRight(BaseTextPreparedSelection.java:108)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2$2.invoke(TextFieldKeyInput.java:111)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2$2.invoke(TextFieldKeyInput.java:111)
at androidx.compose.foundation.text.selection.BaseTextPreparedSelection.collapseRightOr(BaseTextPreparedSelection.java:137)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.java:111)
at androidx.compose.foundation.text.TextFieldKeyInput$process$2.invoke(TextFieldKeyInput.java:104)
at androidx.compose.foundation.text.TextFieldKeyInput.commandExecutionContext(TextFieldKeyInput.java:224)
at androidx.compose.foundation.text.TextFieldKeyInput.process-ZmokQxo(TextFieldKeyInput.java:104)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke-ZmokQxo(TextFieldKeyInput.kt:258)
at androidx.compose.foundation.text.TextFieldKeyInputKt$textFieldKeyInput$2$1.invoke(TextFieldKeyInput.kt:258)
at androidx.compose.ui.input.key.KeyInputInputModifierNodeImpl.onKeyEvent-ZmokQxo(KeyInputInputModifierNodeImpl.java:97)
at androidx.compose.ui.focus.FocusOwnerImpl.dispatchKeyEvent-ZmokQxo(FocusOwnerImpl.java:180)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent-ZmokQxo(AndroidComposeView.android.kt:631)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.android.kt:639)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1922)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:453)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1839)
at android.app.Activity.dispatchKeyEvent(Activity.java:3953)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:367)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5413)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5281)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4947)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5004)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4815)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4788)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4841)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4807)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4980)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5141)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3064)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2607)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2598)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3041)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:143)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:174)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
ni...@bryo.fr <ni...@bryo.fr> #44
Compose 1.4.0
Kotlin 1.8.10
Stacktrace :
Fatal Exception: java.lang.IllegalArgumentException: lineIndex(-1) is out of bounds [0, 1)
at androidx.compose.ui.text.MultiParagraph.requireLineIndexInRange(MultiParagraph.kt:783)
at androidx.compose.ui.text.MultiParagraph.getLineTop(MultiParagraph.kt:681)
at androidx.compose.ui.text.TextLayoutResult.getLineTop(TextLayoutResult.kt:423)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.getLastVisibleOffset(MultiWidgetSelectionDelegate.kt:57)
at androidx.compose.foundation.text.selection.MultiWidgetSelectionDelegate.getLastVisibleOffset(MultiWidgetSelectionDelegate.kt:172)
at androidx.compose.foundation.text.TextController$drawTextAndSelectionBehind$1.invoke(CoreText.kt:422)
at androidx.compose.foundation.text.TextController$drawTextAndSelectionBehind$1.invoke(CoreText.kt:418)
at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:119)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.BorderKt$drawRoundRectBorder$1.invoke(Border.kt:341)
at androidx.compose.foundation.BorderKt$drawRoundRectBorder$1.invoke(Border.kt:340)
at androidx.compose.ui.draw.CacheDrawNode.draw(DrawModifier.kt:210)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.Background.draw(Background.kt:107)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:352)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.Background.draw(Background.kt:107)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:352)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawContent(LayoutNodeDrawScope.kt:64)
at androidx.compose.foundation.DrawOverscrollModifier.draw(AndroidOverscroll.kt:79)
at androidx.compose.ui.node.BackwardsCompatNode.draw(BackwardsCompatNode.kt:352)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-x_KDEd0$ui_release(LayoutNodeDrawScope.kt:92)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:350)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.performDraw(LayoutModifierNodeCoordinator.kt:182)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers(NodeCoordinator.kt)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:370)
at androidx.compose.ui.node.NodeCoordinator$invoke$1.invoke(NodeCoordinator.kt:369)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:369)
at androidx.compose.ui.node.NodeCoordinator.invoke(NodeCoordinator.kt:57)
at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.android.kt:209)
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:301)
at androidx.compose.ui.platform.RenderNodeLayer.drawLayer(RenderNodeLayer.android.kt:242)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:334)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(InnerNodeCoordinator.kt:154)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(NodeCoordinator.kt:347)
at androidx.compose.ui.node.NodeCoordinator.draw(NodeCoordinator.kt:339)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(LayoutNode.kt:939)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:1046)
at android.view.View.draw(View.java:24409)
at android.view.View.updateDisplayListIfDirty(View.java:23267)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4732)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4704)
at android.view.View.updateDisplayListIfDirty(View.java:23214)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:777)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:783)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:881)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:5647)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5330)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4486)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3116)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1301)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1309)
at android.view.Choreographer.doCallbacks(Choreographer.java:923)
at android.view.Choreographer.doFrame(Choreographer.java:852)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1283)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
ha...@google.com <ha...@google.com> #45
0
height, last visible offset calculation tries to look for line index -1
. I'm creating a separate issue to track.
lo...@gmail.com <lo...@gmail.com> #46
ha...@google.com <ha...@google.com> #47
They seem to be similar. At the time of writing my comment I didn't realize a separate issue already existed albeit the issue content was just a stacktrace that couldn't be identified.
There seems to be a regression that brought back the same error. Thanks for pointing it out.
ch...@gmail.com <ch...@gmail.com> #48
au...@gmail.com <au...@gmail.com> #49
kl...@google.com <kl...@google.com> #50
I can't reproduce this on the latest build. I think it's been fixed in 1.5 or 1.6.
te...@gmail.com <te...@gmail.com> #51
ma...@gmail.com <ma...@gmail.com> #52
Fatal Exception: java.lang.IllegalArgumentException: offset(22) is out of bounds [0, 22)
at androidx.compose.ui.text.MultiParagraph.requireIndexInRange(MultiParagraph.kt:831)
at androidx.compose.ui.text.MultiParagraph.fillBoundingBoxes-8ffj60Q(MultiParagraph.kt:543)
at androidx.compose.ui.text.input.CursorAnchorInfoBuilder_androidKt.addCharacterBounds(CursorAnchorInfoBuilder_android.kt:145)
at androidx.compose.ui.text.input.CursorAnchorInfoBuilder_androidKt.build(CursorAnchorInfoBuilder_android.kt:81)
at androidx.compose.ui.text.input.CursorAnchorInfoController.updateCursorAnchorInfo(CursorAnchorInfoController.android.kt:147)
at androidx.compose.ui.text.input.CursorAnchorInfoController.updateTextLayoutResult(CursorAnchorInfoController.android.kt:117)
at androidx.compose.ui.text.input.TextInputServiceAndroid.updateTextLayoutResult(TextInputServiceAndroid.android.kt:434)
at androidx.compose.ui.text.input.TextInputSession.updateTextLayoutResult(TextInputService.kt:215)
at androidx.compose.foundation.text.TextFieldDelegate$Companion.updateTextLayoutResult$foundation_release(TextFieldDelegate.java:202)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$onPositionedModifier$1.invoke(CoreTextField.kt:438)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$onPositionedModifier$1.invoke(CoreTextField.kt:415)
at androidx.compose.ui.layout.OnGloballyPositionedNode.onGloballyPositioned(OnGloballyPositionedModifier.kt:78)
at androidx.compose.ui.node.LayoutNode.dispatchOnPositionedCallbacks$ui_release(LayoutNode.kt:1100)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:72)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:76)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:76)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatchHierarchy(OnPositionedDispatcher.kt:76)
at androidx.compose.ui.node.OnPositionedDispatcher.dispatch(OnPositionedDispatcher.kt:63)
at androidx.compose.ui.node.MeasureAndLayoutDelegate.dispatchOnPositionedCallbacks(MeasureAndLayoutDelegate.kt:653)
at androidx.compose.ui.platform.AndroidComposeView.updatePositionCacheAndDispatch(AndroidComposeView.android.kt:1121)
at androidx.compose.ui.platform.AndroidComposeView.onLayout(AndroidComposeView.android.kt:1095)
at android.view.View.layout(View.java:23868)
at android.view.ViewGroup.layout(ViewGroup.java:6483)
at androidx.compose.ui.platform.AbstractComposeView.internalOnLayout$ui_release(ComposeView.android.kt:322)
at androidx.compose.ui.platform.AbstractComposeView.onLayout(ComposeView.android.kt:313)
at android.view.View.layout(View.java:23868)
at android.view.ViewGroup.layout(ViewGroup.java:6483)
(...)
uj...@gmail.com <uj...@gmail.com> #53
This is still happening in compose BOM 2024.02.02 It happens only when using samsung keyboard & works fine when using gboard And also it happens when visual transformation is applied & dot (.) is added
cl...@google.com <cl...@google.com> #54
This has been re-reported by Meta as happening in 1.7-beta04. I have asked them to post an update here on what they are seeing so they can help identify the issue
se...@google.com <se...@google.com>
ha...@google.com <ha...@google.com> #55
Created
Description
If this is a bug in the library, we would appreciate if you could attach:
Stack Trace