Fixed
Status Update
Comments
lp...@google.com <lp...@google.com> #2
Fatal Exception: java.lang.IllegalArgumentException: offset(9) is out of bounds [0, 8]
at androidx.compose.ui.text.MultiParagraph.requireIndexInRangeInclusiveEnd(MultiParagraph.kt:593)
at androidx.compose.ui.text.MultiParagraph.getCursorRect(MultiParagraph.java:442)
at androidx.compose.ui.text.TextLayoutResult.getCursorRect(TextLayoutResult.kt:390)
at androidx.compose.foundation.text.TextFieldScrollKt.getCursorRectInScroller(TextFieldScrollKt.java:207)
at androidx.compose.foundation.text.TextFieldScrollKt.access$getCursorRectInScroller(TextFieldScrollKt.java:1)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke(TextFieldScroll.kt:179)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke$bridge(TextFieldScroll.kt:12)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke(TextFieldScroll.kt:178)
at androidx.compose.foundation.text.HorizontalScrollLayoutModifier$measure$1.invoke$bridge(TextFieldScroll.kt:27)
at androidx.compose.ui.layout.MeasureScope$layout$1.placeChildren(MeasureScope.kt:68)
le...@google.com <le...@google.com>
le...@google.com <le...@google.com>
ap...@google.com <ap...@google.com> #3
It's hard to tackle the issue without a repro, I couldn't reproduce the crash using Compose's demo app.
It would help if you provide a repro, or at least a code of how the text field is used in your app.
ap...@google.com <ap...@google.com> #4
I havent seen this issue for a couple of weeks now. Perhaps it was fixed thanks to some other set of fixes? Im currently using compose 1.2.0-alpha01.
Beyond that, I have no idea what might have been triggering this. The only thing that stands out to me is that my VisualTransformation also handles cases 0-8, so it could be related to that? Im using one text field composable everywhere (from the design system); but the stack-trace doesnt really point to any specific screen, so I dont think that helps much.
Edit: Seems like I jinxed it, the issue just popped up in my crashlytics logs again this afternoon.
Beyond that, I have no idea what might have been triggering this. The only thing that stands out to me is that my VisualTransformation also handles cases 0-8, so it could be related to that? Im using one text field composable everywhere (from the design system); but the stack-trace doesnt really point to any specific screen, so I dont think that helps much.
Edit: Seems like I jinxed it, the issue just popped up in my crashlytics logs again this afternoon.
ap...@google.com <ap...@google.com> #5
Ive managed to recreate this!
My setup is as follows;
Scaffold contains a pager, and a bottom bar with a couple of text fields. Whenever the page changes, the text is updated to reflect the text thats assigned to the given page.
If I input some text, long press it so that the selection handles are visible, swipe to the next page (which effectively clears the text, and dismisses the selection handle); and then swipe back, the crash happens, presumably because the state has the selection handles visible, but the text no longer being available, hence the out of bounds crash.
My setup is as follows;
Scaffold contains a pager, and a bottom bar with a couple of text fields. Whenever the page changes, the text is updated to reflect the text thats assigned to the given page.
If I input some text, long press it so that the selection handles are visible, swipe to the next page (which effectively clears the text, and dismisses the selection handle); and then swipe back, the crash happens, presumably because the state has the selection handles visible, but the text no longer being available, hence the out of bounds crash.
sh...@google.com <sh...@google.com>
ap...@google.com <ap...@google.com> #6
Thanks for more details.
ap...@google.com <ap...@google.com> #7
Related to
ap...@google.com <ap...@google.com> #8
I also experienced this. I created this ticket and it's most likely related:
pr...@google.com <pr...@google.com> #9
I think
Description
There's a long standing feature request of having a 2d drag, similar to the one we have for 1d Modifier.draggable.
Right now people use their own version using lower level building blocks, but a few features will be missing in their code: InteractionSource support or mutex-based priority dragging being a few to mention.
We need to expose the right building blocks for easy wiring or provide a ready to use modifier for such cases. Seems like this issue might be a good foundation for 2d scroll as well ( b/214410040 ).
Over to Levi to start building up his backlog, but feel free to reassign to me or foundation alias if there are any questions or concerns.