egui_web: constrain the IME text agent to the canvas - #830
Conversation
| // style.set_property("top", &(y.to_string() + "px")).ok()?; | ||
| // style.set_property("left", &(x.to_string() + "px")).ok() | ||
| // }) | ||
| // } else { |
There was a problem hiding this comment.
did you think about what this code was being used for? have you tested that IME still works as expected?
There was a problem hiding this comment.
Oh sorry, I must have misunderstood a bit. I feel that by suppressing the position of the text agent from almost sticking out of the client area of the browser, the position of the IME will also stay in line with the position of the text cursor. Is this a good fix?
There was a problem hiding this comment.
@n2 wrote the original code, perhaps they have some thoughts?
|
@emilk I've also checked the IME position tracking. There is a subtle difference in the IME position tracking compared to the browser native text input, but it seems to be a practical problem. |
f99b0b8 to
cc79d05
Compare
|
Note: For some reason the CI test was failing, so I rebased to the latest master branch. When I did that, the old commits you had linked to the review comments disappeared. |
|
As mentioned in the comments, move_text_cursor() is used to move IME candidate window following egui's cursor. It is better to constrain the position within the canvas, rather than just delete the function. I think your newly submitted code is suitable. Thank you for fixing the overlooked part of my code. @sumibi-yakitori |
If you enter a large number of line breaks where the height of
TextEditexceeds the height of the browser window, and then enter more non-line breaks, the egui screen will be driven out of the client areaAlso, since scrolling is currently disabled in a browser itself, there doesn't seem to be much benefit in changing the position of thetext_agentI apologize for my terrible English