Skip to content

fix: scroll field into view after window resize instead of bumping block - #10373

Open
mikeharv wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
mikeharv:input-bump
Open

fix: scroll field into view after window resize instead of bumping block#10373
mikeharv wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
mikeharv:input-bump

Conversation

@mikeharv

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10277

Proposed Changes

FieldInput.repositionForWindowResize no longer bumps the block into the viewport. Instead, it calls scrollBoundsIntoView so the field pans into view and the block’s workspace position is unchanged.
This required adding an optional shouldHidePopups param to workspace.scroll() so to prevent hideChaff from being called.
The window resize handler in inject.ts calls svgResize before dropdown/widget repositioning so there's no chance of using stale cached metrics.

Reason for Changes

Bumping a block wider than the view when an input field is being edited and the window resizes (for example the mobile Android keyboard) left-aligns it to the flyout, so the focused field goes off-screen.

Testing

I validated the changes to the best of my ability using desktop Chrome. I do not have an Android device available for further testing.
I tested the need for the resize handler manually by using a setTimeout function in the console to significantly shrink the injection div then fire resize. With the original sequence, the focused field/block still end up hidden below the viewable workspace bounds:

Screen.Recording.2026-08-27.at.12.40.17.PM.mov

@mikeharv
mikeharv requested a review from a team as a code owner August 27, 2026 16:41
@mikeharv
mikeharv requested a review from maribethb August 27, 2026 16:41
@github-actions github-actions Bot added the PR: fix Fixes a bug label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focusing an input causes blocks to move on mobile

2 participants