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

iOS TextField, Compound emojis are being treated as many symbols #3104

Closed
etolstoy opened this issue Apr 24, 2023 · 2 comments
Closed

iOS TextField, Compound emojis are being treated as many symbols #3104

etolstoy opened this issue Apr 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working ios reproduced

Comments

@etolstoy
Copy link
Contributor

Describe the bug
Compound emojis such as πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ to a TextField aren't treated as a single symbol, as oppose to iOS native behavior. This affects deletion of such symbols and navigation using arrows on a physical keyboard.

IMG_0037.MP4

(note that due to #3103 it removes two characters in a row instead of one with an on-screen keyboard)

Affected platforms

  • iOS

Versions

  • Kotlin version*: 1.8.20
  • Compose Multiplatform version*: 1.4.0
@MatkovIvan
Copy link
Member

MatkovIvan commented May 2, 2023

Found some related info during investigation of another issue, so let me put here a few details that (I hope) will help:

  1. This is iOS specific issue, on desktop it works just fine. The logic for iterate over symbols properly implemented on both JVM and native. See BreakIterator in skiko (TODO move to icu package)
  2. The reason of it is that iOS calls not just deleteBackward method, but selects one symbol before it. It causes deleting selected area instead of deleting one emoji symbol.
  3. Theoretically, proper iterating should be already supported by native UITextInputStringTokenizer by default, but somehing goes wrong here. I didn't found easy fix (but I soo hoped to do it) during my investigation.
  4. It worth to note that flutter has a lot of workarounds in similar place, so PTAL before fixing it.

Formal unicode/ICU specs for it: Boundary Analysis, Grapheme Cluster Boundaries

cc @dima-avdeev-jb

@dima-avdeev-jb dima-avdeev-jb changed the title Compound emojis are being treated as many symbols iOS TextField, Compound emojis are being treated as many symbols Jun 19, 2023
@dima-avdeev-jb
Copy link
Contributor

Done, will be available in next dev builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios reproduced
Projects
None yet
Development

No branches or pull requests

3 participants