-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
[Proposal] Add support for automatically switching text input to RTL
or LTR
based on first character typed
#91738
Comments
Not only |
Hi @sm2017, I'm not particularly familiar with |
See https://en.m.wikipedia.org/wiki/Bidirectional_text There is a bidi class in flutter https://api.flutter.dev/flutter/intl/Bidi-class.html It is impossible to implement my feature request in application layer, because we have dependencies that has text field or text widget |
@sm2017, my question was poorly phrased, what I meant was can you expand a bit more on this statement you made earlier?
|
Let me describe default behavior of text input in Android os, Chrome, Whatsapp and ... In your Chrome search bar, try to type It's Bidirectional text input as it's context-aware |
RTL
or LTR
based on first character typed
@sm2017, thanks for the insight. |
It might be a good idea to add a new value called For reference here are the docs on |
I need this, it's so useful. I added some code to |
@goderbauer This seems technically feasible (https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/ubidi_8h.html#a165ae276878c7a54fd8b067db0d12f40). Does it make sense to add this to |
Use case
In multilingual text fields, Bidirectional text input is automatically recognised. For example, typing
ب
as the first character inWhatsapp
places the cursor the right side and typingb
as the first, places the cursor at the left side. That is it automatically detects the language and makes the text input appropriate, whether it is anRTL
orLTR
language.Proposal
I think flutter must detect bidirectional text input out of the box, no matter what is the current
Directionality.of(context)
. The same behaviour stated above should be exhibited in flutter textfields.The text was updated successfully, but these errors were encountered: