Skip to content
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

Fix focus in Cupertino textfield #952

Merged
merged 2 commits into from
Dec 25, 2023

Conversation

mazunin-v-jb
Copy link

@mazunin-v-jb mazunin-v-jb commented Dec 18, 2023

Proposed Changes

added explicit showing keyboard method in focused textfield (like it is in android)

Testing

Test: open app, go to Application layouts, toggle "Insets" switch, then try to click on 'show keyboard' textfield and 'hide keyboard' button repetitively.

Issues Fixed

https://youtrack.jetbrains.com/issue/COMPOSE-667/fix-Regression-with-TextField-and-Keyboard

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.

@mazunin-v-jb mazunin-v-jb self-assigned this Dec 18, 2023
@@ -98,6 +98,12 @@ private fun getTapHandlerModifier(
detectRepeatingTapGestures(
onTap = { touchPointOffset ->
if (currentState.hasFocus) {
// To show keyboard if it was hidden. Even in selection mode (like native)
tapTextFieldToFocus(
Copy link
Author

@mazunin-v-jb mazunin-v-jb Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dima-avdeev-jb
It seems like I messed up with the naming of that method in Common code in my previous request dedicated to that feature. Under the hood, this method is responsible to focus if textfield was unfocused and to show the keyboard if textfield was focused. Should I make another request for fixing that, or I can fix it here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can fix it in this PR too

@dima-avdeev-jb
Copy link

I will wait fix with naming and approve after that

Copy link

Test Results

66 tests   66 ✔️  0s ⏱️
10 suites    0 💤
10 files      0

Results for commit b34c64c.

@mazunin-v-jb mazunin-v-jb merged commit 384e6d8 into jb-main Dec 25, 2023
7 checks passed
@mazunin-v-jb mazunin-v-jb deleted the v.mazunin/dev/fix-focus-in-cupertino-textfield branch December 25, 2023 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants