Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #20261
Closed
Open
Issue created Jul 08, 2016 by Administrator@rootContributor

Scrollspy _getScrollTop() uses Window.scrollY which is not supported in IE

Created by: steve-32a

Current code: https://github.com/twbs/bootstrap/blob/v4-dev/js/src/scrollspy.js

_getScrollTop() {
  return this._scrollElement === window ?
      this._scrollElement.scrollY : this._scrollElement.scrollTop
}

MDN says the Window.scrollY property is not supported in IE. I was able to confirm this in IE (11.0.9600.18282) on Windows 7. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY

One solution is to call jQuery.scrollTop() if scrollY is undefined. This works in IE on Windows 7. https://api.jquery.com/scrollTop/

_getScrollTop() {
  return this._scrollElement === window ?
      this._scrollElement.scrollY || $(this._scrollElement).scrollTop() : this._scrollElement.scrollTop
}
Assignee
Assign to
Time tracking