-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
IME editor position is non-deterministic when triggered from outside the viewport #229577
Comments
it feels worse in SCM view sometimes Screen.Recording.2024-09-24.at.11.09.27.AM.mov |
I am able to reproduce this both on VS Code desktop and web. Using the EditContext I am visualizing the control bounds (colored in blue but it coincides with the selection bounds), selection bounds (in red) and character bounds (in green). I see the following: Screen.Recording.2024-09-26.at.12.47.07.movYou can see the character and selection bounds update correctly on typing before and after scrolling the window, but not during the scrolling (this is because we do not call I initially thought this was happening because I did not update the bounds on scrolling. So I added some logic to make the bounds move with the scrolling and clip to the bounds of the overflow guard container when the bounds go out of view. I see the following behavior: Screen.Recording.2024-09-26.at.14.45.49.movIt's slightly better behavior in that the IME input is initially not correctly placed on scrolling, but after this it correctly positions after if you continue to type. Since this does not totally work either, I thought I'd check if I can reproduce this issue on a sample Demo showing how to use the EditContext. Using the following HTML page which is adapted from the Edge EditContext Demo:
<title>Edit Context API: HTML editor demo</title>
An opening it up with Live Server, I do the following:
Screen.Recording.2024-09-26.at.15.03.00.movFrom this I think this incorrect positioning could be a chromium bug and I will file an issue to the team. I could PR to fix this with the logic I found that slightly improves the IME positioning as a workaround. |
As a side note, the same issue happens when you type at the bottom, scroll upwards, then scroll dowwards on typing. In this case for some reason the IME is not correctly positioned and then even if you type it is not correctly repositioned either. This happens both in VS Code and the EditContext Demo. |
Issue filed here: https://issues.chromium.org/issues/369756819 |
Testing #229383
Not sure if EditContext should handle this better than the traditional textarea, but it seems the position of IME editor is still non-deterministic if the focus is on a view line that's outside of the viewport
Textarea

EditContext

The text was updated successfully, but these errors were encountered: