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

Fix page scrolling when typing into new discussions text box #10621

Conversation

notbakaneko
Copy link
Collaborator

position: sticky and scroll-padding don't quite behave well together.
Typing into the text area or selecting text constantly triggers scrolling into view and the combination of position: sticky and scroll-padding makes the entire page scroll; this doesn't happen if the total scroll-padding-top is less vertical position where it's focusing into view (which it normally isn't).

closes #10578

typing into it triggers scrolling into view and scroll-padding doesn't quite behave the way we want to with position sticky
@@ -357,6 +358,10 @@ export class Main extends React.PureComponent
@cache.groupedBeatmaps ?= BeatmapHelper.group _.values(@beatmaps())


handleNewDiscussionFocus: =>
document.documentElement.style.removeProperty '--scroll-padding-top-extra'
Copy link
Collaborator

@nanaya nanaya Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use a note it's for this chrome (and safari) bug

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually forgot to put a comment after figuring out the cutoffs where the scrolling starts 👀

@nanaya nanaya merged commit 79a23b8 into ppy:master Oct 6, 2023
@notbakaneko notbakaneko deleted the feature/discussions-unset-scroll-padding-extra-on-sticky-focus branch October 19, 2023 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Typing or selecting text causes beatmap discussion page to scroll up
2 participants