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

Compose for Web: Initial IME support #1085

Conversation

jershell
Copy link

@jershell jershell commented Feb 8, 2024

Proposed Changes

This PR is an attempt to provide basic support and accumulate knowledge about the state of affairs with keyboard (ime) in mobile web browsers

Testing

chrome on mobile device - ok
safari on mobile device - ok

Test:
Desktop browsers are not affected.
On mobile devices the keyboard is visible and works =\

Google CLA

OK

Working demo

Screenrecorder-2024-02-08-18-26-48-399.mp4

Demo problems

Screenrecorder-2024-02-08-18-27-39-629.mp4

Comments

`<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">`

user-scalable=0 set to 0 to prevent default zoom in safari browser

Limitations

  • Bad text selection
  • Context menu.

Note

Based on the information at this time, several implementation options are likely.

  • By precise positioning, highlight content inside html input, provoking the browser to show the system context menu.
  • Implement the context menu by compose.
  • Poor positioning to focused input.

Note

The keyboard changes the current viewPort, which does not work exactly, perhaps on google chrome you can use https://developer.chrome.com/blog/viewport-resize-behavior, but it is not clear what to do with safari

  • safari doesn't show keyboard when clicking on focused TextField again.

Additional. Why is the VirtualKeyboard API not used.

Summary of the VirtualKeyboard API https://w3c.github.io/virtual-keyboard/ at 2024

@jershell
Copy link
Author

@eymar Hello. Can you help me with this PR?

@eymar eymar requested review from eymar and Schahen February 13, 2024 10:32
@eymar eymar changed the title Initial IME support Compose for Web: Initial IME support Feb 14, 2024
@jershell
Copy link
Author

@eymar Hello, is there any news on my PR?

@eymar
Copy link
Collaborator

eymar commented Feb 16, 2024

Hi @jershell ! Thanks for a ping. The feature you implemented is really important and we appreciate your contribution :)

We would like to carefuly evaluate this solution with its nuances and the possible alternatives if they are necessary.
Currently, the team is preparing (planning) for the next milestone. We'll make sure this feature is included.
That means we'll review this PR properly a bit later.

@jershell
Copy link
Author

@eymar Hello, any news?

@eymar
Copy link
Collaborator

eymar commented Feb 27, 2024

@eymar Hello, any news?

No news yet :)
We will not forget about this PR - I can promise that. This feature is a must-have for 1.6.10 release.

@jershell
Copy link
Author

I pulled latest master. Now we have a bug. The click does not hit on widget. I mention that the bug is not mine -_- and the keyboard works, you just need to press higher (about 50-60dp).

# Conflicts:
#	compose/mpp/demo/src/jsMain/resources/index.html
#	compose/mpp/demo/src/wasmJsMain/resources/index.html
#	compose/ui/ui/src/webCommonW3C/kotlin/androidx/compose/ui/window/ComposeWindow.js.kt
@jershell
Copy link
Author

@eymar Hello. I see version 1.6.10*** got it. Does this mean that we can soon merge this PR?

@ismai117
Copy link

@jershell does the keyboard now show up if I use v1.6.10-dev1551?

@jershell
Copy link
Author

@jershell does the keyboard now show up if I use v1.6.10-dev1551?

no, only after the merger

@jershell
Copy link
Author

jershell commented Apr 9, 2024

@eymar hi, any news?

@eymar
Copy link
Collaborator

eymar commented Apr 9, 2024

@eymar hi, any news?

@Schahen is working on this topic (related parts).

@Schahen
Copy link
Collaborator

Schahen commented Apr 10, 2024

@jershell Hi jershell, I'd had to recompose you PR due to the changes in our event-related approach in general, but don't think that your contribution is wasted - it's actually quite the opposite, we've based our changes on the work you provided (and make sure that the authorship will be preserved in the final merge that's yet to be)

you can check #1259 for further progress
this PR I am closing.

@Schahen Schahen closed this Apr 10, 2024
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.

4 participants