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

Track overridden subtypes when auto-switching due to HintLocales #1410

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

unlair
Copy link
Contributor

@unlair unlair commented Mar 7, 2025

Fixes #1409

This has to do with keyboardOptions.hintLocales (e.g., in TextFields) causing input languages (subtypes) to be automatically changed. This change tracks the subtype being overridden by a HintLocale so that it can gracefully reset when the HintLocale is no longer being applied.

If the user switches languages after a HintLocale is applied, the overridden subtype is cleared so that the new language will stick until a new HintLocale is applied again.

A possible limitation unresolved by this PR is that a HintLocale will always override when first encountered, so if you manually switch to something else and go to another app then come back, it will clear your selection.

@Helium314
Copy link
Owner

Thanks, this should be fine, also with the limitation.

I think it would make sense to store the previous subtype in SubtypeState, and maybe move the switching based on hint locales there (not sure why I hadn't put it there previously).
Do you agree, or is there a good reason to keep it the current way?

@unlair
Copy link
Contributor Author

unlair commented Mar 10, 2025

Thanks! I agree, would be better there. I added some changes to do that. I left the actual switching logic outside of SubtypeState and instead let the caller do the switch with the subtype returned by SubtypeState, to avoid having SubtypeState calling LatinIME.mHandler directly.

@Helium314
Copy link
Owner

Thanks!

@Helium314 Helium314 merged commit d05a59e into Helium314:main Mar 11, 2025
@unlair unlair deleted the hintlocales branch March 13, 2025 02:29
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.

Input language does not switch back when overridden with a Locale Hint
2 participants