-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to delete a word via Ctrl+Backspace in an empty TextField causes an exception #2466
Comments
Thanks! Reproduced in Compose 1.2.1, doesn't reproduce in 1.1.1, Windows/macOS A minimal reproducer:
After the fix we should write tests for word removal behavior |
I've looked into this issue, and it seems to be a small fix. Current code: // frameworks/support/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextPreparedSelection.kt:345
private fun charOffset(offset: Int) =
offset.coerceAtMost(text.length - 1) I'm not able to test this as I don't have the necessary development environment setup (Any link or guide would be appreciated, I'd like to contribute more), but the fix should be: private fun charOffset(offset: Int) =
offset.coerceIn(0, text.length - 1) |
@silenium-dev We don't have a full-fledged Contribution guide yet, but you here's how we setup the project: https://github.com/JetBrains/compose-jb/blob/master/compose/README.md (note: it differs from the upstream aosp repo setup) For contributions to common code (either to the fork https://github.com/Jetbrains/androidx, or aosp) it's required to sign the CLA https://android-review.googlesource.com/settings/new-agreement so your contribution can be further upstreamed, or you may want to submit it directly to the upstream repo right away (skipping the JB fork repo - different project setup) - https://source.android.com/docs/setup/contribute/submit-patches. |
Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]>
There's an existing issue on Google's issue tracker by the way. |
Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]>
Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]> Co-authored-by: Silas <[email protected]>
merged the fixed into JB fork for now. It has to be upstreamed. |
Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]> Co-authored-by: Silas <[email protected]>
Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]> Co-authored-by: Silas <[email protected]>
Issue JetBrains#2466 Co-Authored-By: Silas <[email protected]> Co-authored-by: Silas <[email protected]>
Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]> Co-authored-by: Silas <[email protected]>
…in TextField (#329) Issue JetBrains/compose-multiplatform#2466 Co-Authored-By: Silas <[email protected]> Co-authored-by: Silas <[email protected]>
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
I've built a minimal example: https://github.com/silenium-dev/bug-report-example
I'll try to fix it myself and submit a pull request.
Stacktrace:
The text was updated successfully, but these errors were encountered: