fix: track visualViewport continuously during scroll lock#273
Open
sun-mota wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the scroll-lock implementation in AuroFloatingUI to keep fullscreen bib positioning in sync with iOS visualViewport changes (notably during virtual keyboard interactions), preventing the bib from drifting when the viewport pans.
Changes:
- Switch from a one-time
visualViewport.offsetTopadjustment to continuous tracking viavisualViewportresize+scrolllisteners while scroll is locked. - Add teardown logic to remove the
visualViewportlisteners when unlocking scroll. - Stop forcing
.containermaxHeighttovisualViewport.heightduring fullscreen strategy setup (now resets to default instead).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sun-mota
force-pushed
the
sunMota/floatingui-bib-cut-with-vkb
branch
from
July 22, 2026 20:45
88537cc to
85e9b35
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
scripts/runtime/floatingUI.mjs:370
- The new visualViewport tracking logic (RAF-throttled scroll/resize listeners + unlock cleanup) introduces non-trivial behavior that isn't covered by the existing lockScroll tests. Consider adding a focused unit test that stubs window.visualViewport (with add/removeEventListener + offsetTop) and verifies: (1) listeners are registered on lock, (2) transform updates are applied via RAF when scroll/resize fires, and (3) listeners + any pending RAF are cleaned up on unlock.
if (window.visualViewport) {
this._viewportRafId = undefined;
this._viewportHandler = () => {
if (this._viewportRafId !== undefined) {
return;
}
this._viewportRafId = requestAnimationFrame(() => {
this._viewportRafId = undefined;
if (element?.bib) {
element.bib.style.transform = `translateY(${window.visualViewport.offsetTop}px)`;
}
});
};
window.visualViewport.addEventListener(
"resize",
this._viewportHandler,
);
window.visualViewport.addEventListener(
"scroll",
this._viewportHandler,
);
this._viewportHandler();
Contributor
|
Dev release of this PR:
|
Member
Author
|
DRAFT PR for testing in auto-formkit: AlaskaAirlines/auro-formkit#1571 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Alaska Airlines Pull Request
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Checklist:
By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.
Thank you for your submission!
-- Auro Design System Team