fix(protocol-designer): fix scroll position of MoreOptionsModal #6515
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.
Overview
Closes #6156
Changelog
element.scrollToTop = 0
to use a common utilReview requests
I found there were 2 ways of doing the same thing for the scroll to top behavior, and a lot of repeated code for it, so I factored it out to a new
resetScrollElements
util. The comment about the old issue #4446 still stands, but IMO probably not a priority to address that until we do larger styling changes to PD one day. (Agree/disagree?)Since I did that refactor, we should double-check the scroll behavior of several elements. To check, scroll down as far as you can while still keeping the button you need in view, and ensure that the dark gray modal overlay fills the main panel (instead of weirdly only partially filling it)
Risk assessment
Low, at worst could mess up scroll behaviors of other modals