Permalink
Browse files

fix(scrollspy): Use new offset and position dom utilities

Fixes issues with respect to incorrect offset calculation after resizing
  • Loading branch information...
tmorehouse committed Sep 15, 2017
1 parent baf15ca commit dc68eef97d5d7dbcbf1af93d2787bcb02a6723b0
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/directives/scrollspy.js
@@ -1,6 +1,6 @@
import { isArray } from '../utils/array';
import { assign, keys } from '../utils/object';
import { isElement, isVisible, closest, getBCR, selectAll, select, hasClass, addClass, removeClass, getAttr, eventOn, eventOff } from '../utils/dom';
import { isElement, isVisible, closest, getBCR, offset, position, selectAll, select, hasClass, addClass, removeClass, getAttr, eventOn, eventOff } from '../utils/dom';
const inBrowser = typeof window !== 'undefined';
const isServer = !inBrowser;
@@ -225,7 +225,7 @@ ScrollSpy.prototype.refresh = function () {
const bcr = getBCR(target);
if (bcr.width || bcr.height) {
return {
offset: (offsetMethod === OffsetMethod.OFFSET ? bcr.top : target.offsetTop) + offsetBase,
offset: (offsetMethod === OffsetMethod.OFFSET ? offset(target) : position(target)).top + offsetBase,
href
};
}

0 comments on commit dc68eef

Please sign in to comment.