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

Japanese text input is not rendered inline #1469

Closed
crftwr opened this issue Jan 2, 2023 · 9 comments · Fixed by #3408
Closed

Japanese text input is not rendered inline #1469

crftwr opened this issue Jan 2, 2023 · 9 comments · Fixed by #3408

Comments

@crftwr
Copy link

crftwr commented Jan 2, 2023

Sorry if this is a known issue.

I tried to input Japanese characters on "textual" demo app, and found that Textual app doesn't render IME text / list at expected place.

When typing Japanese characters (and probably other many non-English languages also), applications are expected to render IME text and candidate word list, with the help of the OS. And the position of the text and list should be the caret position in the text input widget.

I tested this only on Mac OS (Ventura 13.0.1), but I will check the same on Windows OS later and update this report.

Please see attached screenshots.

Textual app on Terminal app (unexpected behavior)
screenshot1

Memo app (expected behavior)
screenshot2

Terminal app (expected behavior)
screenshot3

@github-actions
Copy link

github-actions bot commented Jan 2, 2023

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@darrenburns
Copy link
Member

This is a good point - I noticed the same thing with Japanese input.

The issue is that Textual hides the terminal cursor and uses its own "virtual" cursor.

The dropdown appears at the terminal cursor's position, which is at the bottom right of the widget (since the full widget repaints from top left to bottom right).

It seems some TUI apps use the terminal cursor though, so the dropdown appears in the correct position. For example, vim and mc seem fine.

It'll require more research from us, but we definitely acknowledge the issue - thank you for the report!

@crftwr
Copy link
Author

crftwr commented Jan 5, 2023

@darrenburns , thank you for your comment and aknowledgement!

@Lvdi
Copy link

Lvdi commented May 29, 2023

@darrenburns
Hi, is there any plan for fixing this issue (or some hacky workaround)?
It's kind of a dealbreaker for creating IME-aware apps using Textual...

@1dancook
Copy link
Contributor

Came to post about this issue but it's already here thankfully. Hopefully there is a fix soon for this. Thanks for all your hard work!

@darrenburns
Copy link
Member

I'm working on a fix for this now. It should hopefully completely fix the IME issue for both Input and TextArea widgets. IME will stay aligned with the cursor in both of these widgets.

Preview:

image

It also fixes the OS emoji pop-up which had the same problem.

@darrenburns darrenburns mentioned this issue Sep 26, 2023
5 tasks
@1dancook
Copy link
Contributor

I'm working on a fix for this now. It should hopefully completely fix the IME issue for both Input and TextArea widgets. IME will stay aligned with the cursor in both of these widgets.

Preview:

image

It also fixes the OS emoji pop-up which had the same problem.

That's awesome. I don't think I have time this week to check that out and give it a run for its money but I'm looking forward to the change! どうも!

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

@darrenburns
Copy link
Member

This is merged into main and will be available in the next Textual release.

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 a pull request may close this issue.

4 participants