Skip to content
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

Prevent focusing inputs from causing page to scroll offscreen #819

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

luxaritas
Copy link
Member

@luxaritas luxaritas commented Aug 30, 2024

Summary

Currently if you eg have the sequence field in the design browser part way offscreen and then paste a long sequence, if will cause the entire page to shift offscreen. This prevents that from happening

Implementation Notes

By default, browsers move the page so that a focused input (and more specifically, your cursor) is in view. This makes sense, as you want to make sure you see what you're doing, and a keyboard user may be tabbing through input fields which should scroll into view, etc. However: a) scrolling the page is not actually what we want - we haven't actually drawn content there that's just sitting offscreen, it's only "virtually" in our scene and we'd actually need to redraw the scene and b) we have overflow: hidden on our root game element, which means that there is no good way to scroll the content back into view. Additionally, it may be in a ScrollContainer which has it clipped, which means it may not even show the input at all.

Arguably in some situations we should find a way to implement this behavior - eg, in a scroll container, we should just scroll the scroll container. However this is nontrivial, so will leave this to a future enhancement and limit this work to fixing the buggy behavior. See #820.

This patch also removes the input masking hack since we no longer need to support the misbehaving WebKit version, and that was getting in the way of debugging this issue.

@luxaritas luxaritas self-assigned this Aug 30, 2024
@luxaritas luxaritas merged commit 62af09d into dev Aug 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant