Skip to content

Inconsistent caret position when typing emojis into TextField #31818

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
ghost opened this issue Apr 30, 2019 · 3 comments
Closed

Inconsistent caret position when typing emojis into TextField #31818

ghost opened this issue Apr 30, 2019 · 3 comments
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Comments

@ghost
Copy link

ghost commented Apr 30, 2019

Open any TextField and type "abc", then type the rainbow flag emoji. The caret will be displayed before the emoji. The fields baseOffset and extentOffset of TextSelection hold the correct value, so if you type another letter, it will be correctly displayed at the end of the TextField.

This depends on the emoji. If instead of the rainbow flag you were to type the pirate flag, the caret would be displayed at the beginning, before the letter "a".

It seems to me that emojis that are comprised of multiple code points make Flutter confused.

Perhaps these issues are related, but I'm not sure:
dart-lang/language#34
dart-lang/language#49

@ghost ghost changed the title Crazy caret position when typing emojis into TextField Crazy caret position when typing emojis into TextField Apr 30, 2019
@HansMuller HansMuller added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Apr 30, 2019
@HansMuller
Copy link
Contributor

CC @GaryQian

@ghost ghost changed the title Crazy caret position when typing emojis into TextField Inconsistent caret position when typing emojis into TextField Jul 23, 2019
@VladyslavBondarenko
Copy link

Hi @hugocbpassos,
I can't reproduce this

Open any TextField and type "abc", then type the rainbow flag emoji. The caret will be displayed before the emoji. The fields baseOffset and extentOffset of TextSelection hold the correct value, so if you type another letter, it will be correctly displayed at the end of the TextField.

With current master 1.21.0-6.0.pre.90 on Android 9 device and iOS 13.6 simulator

but #50563 still seems to be actual, please follow up on it, closing current issue

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

2 participants