ScrollSpy no longer selects last element when at the bottom of the page
Created by: timfish
This was added in v2.0.3 but appears broken with v4-alpha and ScrollSpy attached to the <body>
. The last item is not selected when you scroll to the bottom of the page.
var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight;
The issue appears to be that maxScroll
is Nan
because this._scrollElement.offsetHeight
is undefined
this._scrollElement = element.tagName === 'BODY' ? window : element;
As I'm using the <body>
element this._scrollElement
is window