floem icon indicating copy to clipboard operation
floem copied to clipboard

Fix text-input Chinese input

Open qingyiwebt opened this issue 7 months ago • 5 comments

Now IME is allowed for the window winit created, and the text input can handle the ImeCommit event,
BUT the render issue when there is CJK text in the text-input still exists.

qingyiwebt avatar Apr 30 '25 15:04 qingyiwebt

https://github.com/user-attachments/assets/c4817d51-a3d8-45d4-a9da-c410d5169976

qingyiwebt avatar Apr 30 '25 15:04 qingyiwebt

We probably should call set_ime_allowed(true) when text input is in focus, and set_ime_allowed(false) when it's out of focus.

https://github.com/lapce/floem/blob/main/src/action.rs#L213

And call set_ime_cursor_area to put the IME candidate box.

dzhou121 avatar Apr 30 '25 15:04 dzhou121

Ok, I will try to solve it tomorrow.

qingyiwebt avatar Apr 30 '25 15:04 qingyiwebt

The calling of set_ime_cursor_area and some fixes is also added in the commit enable IME when text-input focused

qingyiwebt avatar Apr 30 '25 17:04 qingyiwebt

Now text-input should work better with CJK characters and IME, the text overflow problem and cursor position should be fixed too.

https://github.com/user-attachments/assets/ec1e8ce6-9d4d-4517-9c5b-bb8958eda4f1

image

qingyiwebt avatar May 01 '25 04:05 qingyiwebt