-
Notifications
You must be signed in to change notification settings - Fork 4k
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(docs): fix compatibility with IE #1659
Conversation
@@ -27,6 +35,7 @@ export const semanticUICSSRepoURL = 'https://github.com/Semantic-Org/Semantic-UI | |||
|
|||
export const scrollToAnchor = () => { | |||
const anchor = location.hash && document.querySelector(location.hash) | |||
const offsetY = window.scrollY || window.pageYOffset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pageYOffset
is alias for scrollY
, but it's supported from IE 9
3431703
to
2f8f01f
Compare
const scrollStep = Math.ceil((Math.abs(elementTop / 8))) * Math.sign(elementTop) | ||
const isScrolledToTop = offsetY === 0 | ||
const isScrolledToBottom = offsetY + document.body.clientHeight === document.body.scrollHeight | ||
const scrollStep = Math.ceil((Math.abs(elementTop / 8))) * mathSign(elementTop) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Math.sign
is not supported in IE at all.
2f8f01f
to
c0aec92
Compare
Codecov Report
@@ Coverage Diff @@
## master #1659 +/- ##
=========================================
Coverage ? 99.75%
=========================================
Files ? 141
Lines ? 2406
Branches ? 0
=========================================
Hits ? 2400
Misses ? 6
Partials ? 0 Continue to review full report at Codecov.
|
Thanks for the updates. |
Released in |
This fixes docs compatibility with IE.