Skip to content

Fix diacritics input in BTF2 on macOS via long-press #1810

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

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

m-sasha
Copy link
Member

@m-sasha m-sasha commented Jan 29, 2025

Fix diacritics input in BTF2 on macOS via long-press.

Note that the fix itself is to call textInputService.updateState whenever the text changes. The changes in DesktopPlatformInput.desktop.kt are just a minor refactoring.

Testing

Tested manually by long-pressing 'c' on:

val state = rememberTextFieldState()
TextField(state, modifier = Modifier.width(200.dp))

Unfortunately the implementation is not robust enough to be tested automatically. It depends on a call to InputMethodRequests.getSelectedText to activate the behavior, which is not possible to do in a test. We may want to improve this implementation in the future, by imitating what Swing does in JTextComponent.replaceInputMethodText.

This should be tested by QA

Release Notes

Fixes - Desktop

Fixed input of diacritics via long-press on macOS in TextField(TextFieldState) (aka BasicTextField2).

@m-sasha m-sasha requested a review from igordmn January 29, 2025 15:44
@igordmn
Copy link
Collaborator

igordmn commented Jan 29, 2025

Did you check that input method languages still work (Chinese, etc)?

@igordmn
Copy link
Collaborator

igordmn commented Jan 29, 2025

I checked Chinese - works in BTF1/BTF2 on Windows

@m-sasha
Copy link
Member Author

m-sasha commented Jan 30, 2025

Did you check that input method languages still work (Chinese, etc)?

Chinese works.

@m-sasha m-sasha merged commit c1247ae into jb-main Jan 30, 2025
7 checks passed
@m-sasha m-sasha deleted the m-sasha/fix-diacritics-input-in-btf2-on-macos branch January 30, 2025 13:00
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.

2 participants