Skip to content

Fix virtual keyboard behaviour on mobile browsers in iOS #2033

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

Closed
wants to merge 1 commit into from

Conversation

Schahen
Copy link

@Schahen Schahen commented Apr 17, 2025

Fixes https://youtrack.jetbrains.com/issue/CMP-8013

Testing

Manual plus ./gradlew testWeb

Release Notes

N/A

@Schahen Schahen requested a review from MatkovIvan April 17, 2025 13:27
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

tbh it sounds suspicious and risky, but I won't block it as a hotfix with keeping in mind that we need to rework it properly after that

backingElement.focus()
}
}, AddEventListenerOptions(once = true))
backingElement.click()
Copy link
Member

Choose a reason for hiding this comment

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

Will it trigger any security policies in browsers?

// unfortunately on ios touch devices focus won't happen asynchronously
// this leads to https://youtrack.jetbrains.com/issue/CMP-8013
// which we are circumventing via focusing in a triggered click event
backingElement.addEventListener("click", { evt ->
Copy link
Member

Choose a reason for hiding this comment

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

Is there a situation where our event will be handled by somebody else instead of this callback?

@@ -54,9 +54,16 @@ internal class BackingDomInput(
}

fun focus() {
window.requestAnimationFrame {
// we focusing in next frame as a part of fix for https://youtrack.jetbrains.com/issue/CMP-7836/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is "focusing in next frame" still correct comment? I see that we removed window.requestAnimationFrame. Is it now about that we request in a handler that is also in the next frame?

@Schahen
Copy link
Author

Schahen commented Apr 17, 2025

We've came up to an agreement that this looks, very, very suspicios, unreliable and kludgy
Here's our next attempt - #2035

@Schahen Schahen closed this Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants