-
Notifications
You must be signed in to change notification settings - Fork 81
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
Caret behavior by single tap in Cupertino textfields #858
Caret behavior by single tap in Cupertino textfields #858
Conversation
…tyled textfield. Forwarded callback for showing context menu (should be called by tap on the caret)
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
...skikoMain/kotlin/androidx/compose/foundation/text/CupertionTextFieldPointerModifier.skiko.kt
Show resolved
Hide resolved
currentState.processor, | ||
currentOffsetMapping, | ||
currentState.onValueChange | ||
TextFieldDelegate.cupertinoSetCursorOffsetFocused( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is
#913
@MatkovIvan maybe you want to look at it too
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
…into separate method and create enum class - in purpose to make it testable
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
… handling to ui-text, changed logic of caret behavior, added tests
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/CharHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/CharHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/CharHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/CharHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
…n, removed changes in public API (ui-text), refactor logic in TextFieldDelegate.skiko.kt, added documentation to some supplementary functions
compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/CharHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
...tion/foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/StringHelpers.skiko.kt
Show resolved
Hide resolved
...tion/foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/StringHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
...tion/foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/StringHelpers.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
.../foundation/src/skikoMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.skiko.kt
Outdated
Show resolved
Hide resolved
## Proposed Changes - Split behavior for focused and unfocused state, like in native applications. - Added behavior logic for focused state of text field. - Forwarded callback for showing context menu actions by tap on the caret. ## Testing Test: Run App, open Components - TextField - Almost Fullscreen. Try cases described in the documentation of `cupertinoSetCursorOffsetFocused() ` ## Issues Fixed https://youtrack.jetbrains.com/issue/COMPOSE-445/iOS-adjust-caret-behavior-in-textfields-for-single-tap ## Google CLA You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/. This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.
Proposed Changes
Testing
Test: Run App, open Components - TextField - Almost Fullscreen. Try cases described in the documentation of
cupertinoSetCursorOffsetFocused()
Issues Fixed
https://youtrack.jetbrains.com/issue/COMPOSE-445/iOS-adjust-caret-behavior-in-textfields-for-single-tap
Google CLA
You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.