Skip to content

Conversation

@dobromir-hristov
Copy link
Contributor

Bug/issue #, if applicable: 100028167

Summary

Adds an extra offset to the scrollTo helper function, only for the documentation page.

Dependencies

NA

Testing

Steps:

  1. Click on links in OnThisPage nav or other anchors on the page
  2. Assert nav is accounted for + extra 10px for doc pages

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@dobromir-hristov dobromir-hristov marked this pull request as ready for review September 22, 2022 07:51
* @param {import('vue-router').Route} to
* @returns {Number}
*/
export default function getExtraScrollOffset(to) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to move this to the existing router-utils.js file where we already have utilities related to scrolling (and also offsets for scrolling) as opposed to creating an entirely new scroll-offset.js file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thought it might be easier for future 3rd party users to extend this function 🤔

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

@dobromir-hristov dobromir-hristov merged commit 526cd27 into swiftlang:main Sep 26, 2022
@dobromir-hristov dobromir-hristov deleted the dhristov/r100028167-add-scroll-to-offset branch September 26, 2022 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants