**fix(web): prevent entire page from scrolling out of view in Chrome (WASM)** #7888
+6
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(web): prevent entire page from scrolling out of view in Chrome (WASM)
Problem
When using
eguion the web, the browser (especially Chrome) occasionally triggers an unwanted page-level scroll. This happens because the hidden input element (text agent) used for IME/text input is sometimes positioned outside the visible bounds of the canvas, causing the browser to "scroll it into view."Solution
I modified the
move_tofunction in the web'stext_agentto ensure the input element's position stays within the canvas height. By clamping thetopproperty between0.0andcanvas_height, we prevent the browser from incorrectly scrolling the entire page when the text agent moves.clamp(0.0, canvas_height)to theclamped_yvalue before setting the CSStopproperty.