Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Ruana <rob@robruana.com>2016-11-28 03:20:33 +0300
committerMark Otto <markd.otto@gmail.com>2016-11-28 03:20:33 +0300
commit5eddb0b0fdfd7215d5764c5315ce7f0be4ca3d83 (patch)
tree4606c362138e5950e2c4718d3491f95e4ed27483 /js/src/scrollspy.js
parent8d031090d0f2a42b392b3452416539334562e3a7 (diff)
Closes #21055: Prevents ScrollSpy from clearing active item when Safari rubberbands (#21056)
When the rubberband effect causes Safari to scroll past the top of the page, the value of scrollTop becomes negative. If the offset of the first ScrollSpy target is 0 - essentially if the target is at the top of the page - then ScrollSpy should not clear the active item. Conceptually, the first item should remain active when rubberbanding past the top of the page. This commit fixes issue #21055 by verifying the first scrollspy target is not at the top of the page before clearing the active nav-item.
Diffstat (limited to 'js/src/scrollspy.js')
-rw-r--r--js/src/scrollspy.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js
index 9b39acd362..9cb1438ca7 100644
--- a/js/src/scrollspy.js
+++ b/js/src/scrollspy.js
@@ -221,7 +221,7 @@ const ScrollSpy = (($) => {
return
}
- if (this._activeTarget && scrollTop < this._offsets[0]) {
+ if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
this._activeTarget = null
this._clear()
return